Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Browsing all 3027 articles
Browse latest View live

Template issue with std::remove_pointer_t

Hi Guru I am updating my post, so my codes can be better understood; This codes is meant to demonstrate the problem i am facing, although it doesn't do anything much. I run VC++ 2019 with latest...

View Article


Image may be NSFW.
Clik here to view.

Can I export Com function?

Hi, I have created a project with some classes and frequently used functions. Can I export these functions in my custom class to create a lib? I did it like this but got an error Code: class...

View Article


How to get COM function return value

I am using COM function in my code,I have only tli file of the the com project so how will I be able to get the return value of the COM function as in tli file it's not present,where can I see the...

View Article

Does #define change things that come before it?

Does #define change things that came before it? I'd always assumed it did because it's a preprocessor directive but I just found this code in a header file:- Code: typedef struct _stat GStructLarge;...

View Article

How to initialize variant?

Hi, I'm having a hard time initializing the variable as follows: using mytype=std::variant<int, double, int>; I tried this but it doesn't work. mytype k{1,1.124.2}; I've seen this post, but it...

View Article


[RESOLVED] How to initialize variant?

Hi, I'm having a hard time initializing the variable as follows: using mytype=std::variant<int, double, int>; I tried this but it doesn't work. mytype k{1,1.124,2}; I've seen this post, but it...

View Article

Image may be NSFW.
Clik here to view.

Problem with vector?

Hi, This problem took me a long time to fix but it didn't work .. I have a functions like this: Code: struct  ST1 //define global outsize class;           {                 ///...int,bool,.....

View Article

Image may be NSFW.
Clik here to view.

[RESOLVED] Problem with vector?

Hi, This problem took me a long time to fix but it didn't work .. I have a functions like this: Code: struct  ST1 //define global outsize class;           {                 ///...int,bool,.....

View Article


[RESOLVED] How to set excel column width?

I have searched and used some formula: ClientToScreen,.. to find CPoint. My result: Code: CPoint cp1 ;x-y (314;448) CPoint cp2 ;x-y (802;448) from this, Can I draw the CPoint on the screen to check...

View Article


Image may be NSFW.
Clik here to view.

How to kill Excel process?

Hi, I'm doing an action in first debug like this: 1, Create excel instance. 2, During debugging, turn it off suddenly. In some case, this processes still run in background, so when i use getobject code...

View Article

How to avoid Titlebar flicker?

Hi, In the the my code,from MFC form, I call the ::Setfocus(hwnd) function to focus another windows application only once. then i setfocus back to my MFC form. my code like this: Code: HWND...

View Article

expandToFit & centering page content on printed page XPS API

Hello, The following shows the calculation and application of shrink to fit without centering the page content on the printed page. I use a 3rd party library to create the matrix which is then applied...

View Article

Image may be NSFW.
Clik here to view.

How to get worksheet name?

Hi, I'm having trouble locating the worksheet name , My code uses as following: Code: IDispatch* xlSheet; //<--get xlSheet ok   VARIANT result4;     VariantInit(&result4);...

View Article


Why Creatfont not working?

Hi, I'm using the font Calibri, I need to calculated fontwidth of CString L"testtextwidth" from the fontsize 11 or 12(in point) equivalent 14.5 and 16 in pixel. I used the Createfont function as...

View Article

Image may be NSFW.
Clik here to view.

How to expand dropdownlist?

Hi, During using owndraw with has string property, my combobox cannot expand. How can I fix this? Thanks you! Attached Images  

View Article


A CMFCDropDownToolBar Question

I created a CMFCDropDownToolBar embedded in a CMFCToolBar VIA dummy resource button as explained in CMFCDropDownToolBar Class microsoft document,everything works great, but what I want to do is create...

View Article

Image may be NSFW.
Clik here to view.

Where do a project's filters get saved ?

Here's a screenshot showing a typical VC project:- Notice that the various .cpp files are arranged into folders (called 'Filters') with each of them containing one or more .cpp files- BUT.... If I open...

View Article


Image may be NSFW.
Clik here to view.

[RESOLVED] Where do a project's filters get saved ?

Here's a screenshot showing a typical VC project:- Notice that the various .cpp files are arranged into folders (called 'Filters') with each of them containing one or more .cpp files- BUT.... If I open...

View Article

Cancelling _declspec(dllexport)

Just for simplification... Code: class _declspec(dllexport) Whatever { public:     int some_func1 ();     int some_func2 ();     int some_func3 ();     [...]     int some_func20 (); private:     int...

View Article

Stopping unnecessary style corrections

A project I'm involved in has a style of inserting spaces for better visibility - like this:- Code: int SomeFunc ( int whatever ); but if I make any change to an existing line, VS2019 has an annoying...

View Article
Browsing all 3027 articles
Browse latest View live