|
hi all... i am using ICC_BAR_CLASSES to initialize controls to create toolbar....
but i am getting one error
[linker error] undefined reference to `InitCommonControlsEx@4'
code creating problem is...
//-----------------------------------
INITCOMMONCONTROLSEX InitCtrlEx;
InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
InitCtrlEx.dwICC = ICC_BAR_CLASSES;
InitCommonControlsEx(&InitCtrlEx);
//-----------------------------------
As structure INITCOMMONCONTROLSEX and function InitCommonControlsEx(..) are defined in commctrl.h i included this in my program.....earlier INITCOMMONCONTROLSEX this was also giving same error then i opened the header file commctrl.h and there i found these lines
//--------------------------------------
#if (_WIN32_IE >= 0x0300)
typedef struct tagINITCOMMONCONTROLSEX {
DWORD dwSize;
DWORD dwICC;
} INITCOMMONCONTROLSEX,*LPINITCOMMONCONTROLSEX;
#endif
//--------------------------------------
#if (_WIN32_IE >= 0x0300)
BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
#endif
//--------------------------------------
so in my program before header file in included
#ifdef _WIN32_IE
#undef
#endif
#define _WIN32_IE 0x501
and also
#ifdef _WIN32_WINNT
#undef
#endif
#define _WIN32_WINNT 0x501
now INITCOMMONCONTROLSEX is working fine... but i am getting error with InitCommonControlsEx(...)
error is
[linker error] undefined reference to `InitCommonControlsEx@4'
i am using Dev-C++ 4.9.9.2 compiler
can someone suggest me something...
thanx in advance....
bye have a nice day.....
|
|
|
|
|
hey its working now...
what u need to do is just link library....
in case of devc++ ists libcomctrl32.a
bye have a nice day.....
|
|
|
|
|
hi all... i am using ICC_BAR_CLASSES to initialize controls to create toolbar....
but i am getting one error
[linker error] undefined reference to `InitCommonControlsEx@4'
code creating problem is...
//-----------------------------------
INITCOMMONCONTROLSEX InitCtrlEx;
InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX);
InitCtrlEx.dwICC = ICC_BAR_CLASSES;
InitCommonControlsEx(&InitCtrlEx);
//-----------------------------------
As structure INITCOMMONCONTROLSEX and function InitCommonControlsEx(..) are defined in commctrl.h i included this in my program.....earlier INITCOMMONCONTROLSEX this was also giving same error then i opened the header file commctrl.h and there i found these lines
//--------------------------------------
#if (_WIN32_IE >= 0x0300)
typedef struct tagINITCOMMONCONTROLSEX {
DWORD dwSize;
DWORD dwICC;
} INITCOMMONCONTROLSEX,*LPINITCOMMONCONTROLSEX;
#endif
//--------------------------------------
#if (_WIN32_IE >= 0x0300)
BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
#endif
//--------------------------------------
so in my program before header file in included
#ifdef _WIN32_IE
#undef
#endif
#define _WIN32_IE 0x501
and also
#ifdef _WIN32_WINNT
#undef
#endif
#define _WIN32_WINNT 0x501
now INITCOMMONCONTROLSEX is working fine... but i am getting error with InitCommonControlsEx(...)
error is
[linker error] undefined reference to `InitCommonControlsEx@4'
i am using Dev-C++ 4.9.9.2 compiler
can someone suggest me something...
thanx in advance....
bye have a nice day.....
|
|
|
|
|
I'm taking my first steps in .NET and I have some legacy code in C++ that I need to use in .NET code. Any thumb rules or generic way of doing that?
|
|
|
|
|
dedil wrote: I'm taking my first steps in .NET
I would argue that you are skipping the first steps in introducing yourself to .NET and jumping right into a project. IMHO that is not advisable.
|
|
|
|
|
I agree, but it's out of my hands.
Regarding this specific question, the .NET form is not an issue; It should be a blank that just calls a method from a class in the legacy code.
|
|
|
|
|
dedil wrote: that just calls a method
Nice ASSUMPTION? What institution did you study at? I want to make sure to warn people away from it.
|
|
|
|
|
|
Whatever dude, here PInvoke is your just solution.... good luck
|
|
|
|
|
I want to check and validate a newly entered date whether the date belongs to 21st century.
hello
|
|
|
|
|
Welcome to CodeProject. Have you read any of the FAQ's about using the forums on this site? There is one about "how to ask questions" that is very helpful. Also try use the appropriate forum, are you using the .NET framework with your date problem? This forum is for doing .NET development in C++ as the first thread in the list states.
h_he_el_el_o wrote: I want to check and validate a newly entered date whether the date belongs to 21st century.
What "date API(s)" are you working with and what do you know about them? What specifically are you having trouble with?
|
|
|
|
|
suppose if my birthday date is 12.08.86.............how am i supposed to validate this between the year 1970 and 1987
|
|
|
|
|
As you're persisting in asking this in the .NET c++ forum, I assume you're using the .NET DateTime class. One way to do this is to simply create a DateTime that is 31 Dec 1987, subtract your date from that value, and the resultant TimeSpan class will tell you how far you are from the date you specified, this can be used to check a date range.
If you merely ignored the reply you got and persisted in asking in the wrong forum, then none of that will help you. Try the Visual C++ forum.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: If you merely ignored the reply you got
"If"??? I thought it was obvious.
|
|
|
|
|
convert each date in seconds
1 min = 60 sec
1 hour = 60 min
.....
and then look if that numbers are greater (or not) then others.
Russell
|
|
|
|
|
Hi is *this (follow hyperlink) *a Visual Studio 2005 bug (tried Express and Enterprise edition)? Or am I mistaken?
BUG#1: "strTokenA" and "strTokenB" both declared the same way why "strTokenA" "out of scope"??
BUG#2: It's harder to depict, but basically seems like debugger pointing at wrong line of code --- execution flow in linked dll
(of course first thing I make sure I recompiled the whole solution and I'm not linking to wrong dll)
|
|
|
|
|
|
yes that's what I thought, so I tried renaming strings to str1 and str2 - that didn't help. I guess I really need to manually delete all build/intermedate files since rebuild + clean didn't help.
|
|
|
|
|
Not sure about issue #1. The KB article pointed to in the other link is specifically talking about C# keywords, not managed C++, but it might not matter. Does this cause a run time issue or is this more of a curiosity type question?
Issue #2 sounds like it could be related to a mismatch between the .pdb file and the source code. I have seen issues like this that do sometimes survive rebuilds. Have you tried exiting Visual Studio and manually deleting all of the bin/lib/obj files and folders, and then rebuilding?
|
|
|
|
|
even with "clean" + "rebuild solution"? You seen this before?
Thanks
|
|
|
|
|
Yes, even with "clean" + "rebuild". The "clean" doesn't do a full clean where everything except source code files is deleted. Most of the time, it is enough...but every so often it isn't.
|
|
|
|
|
hey hi all... i made a c++ program in which i need to detect USB device inserted event... but my windowProc function is not getting called.. i don't know whats wrong with the program.... i also tried to check the error by using GetLastError() but i got nothing.. code goes like this
#ifdef WINVER
#undef WINVER
#endif
#define WINVER 0x0501
#include
#include
#include
#include
#include
DEFINE_GUID(GUID_DEVINTERFACE_VOLUME, 0x53f5630dL, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
// don't know if this is the correct GUID for USB device interface... i got it from MSDN website....
#define guid GUID_DEVINTERFACE_VOLUME
using namespace std;
HDEVNOTIFY RegisterDeviceNotificationA(
HANDLE hRecipient,
LPVOID NotificationFilter,
DWORD Flags
);
#define RegisterDeviceNotification RegisterDeviceNotificationA
LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // device-change event
LPARAM lParam // event-specific data
);
int main( )
{
HWND hwnd = FindWindow( "ConsoleWindowClass", NULL);
cout<<hwnd<<endl; to="" check="" if="" im="" able="" get="" hwnd="" or="" not......
dev_broadcast_deviceinterface="" notificationfilter;
zeromemory(="" ¬ificationfilter,="" sizeof(notificationfilter)="" );
notificationfilter.dbcc_size="sizeof(DEV_BROADCAST_DEVICEINTERFACE);
NotificationFilter.dbcc_devicetype" =="" dbt_devtyp_deviceinterface;
notificationfilter.dbcc_classguid="guid;
HDEVNOTIFY" hdevnotify;
hdevnotify="RegisterDeviceNotification(" hwnd,="" device_notify_window_handle);
cout<<hdevnotify<<endl;="" the="" value
if(="" !hdevnotify="" )
{
cout<<"registration="" of="" device="" notification="" failed"<<endl;
}
else
{
cout<<"registration="" complete"<<endl;
}
dword="" dword;
dword="GetLastError(" );
cout<<dword<<endl;="" for="" any="" error="" any....
while(1)
{
sleep(1000);
}
return="" 0;
}
lresult="" callback="" windowproc(="" uint="" umsg,="" wparam="" wparam,="" lparam="" )
{
cout<<"windowproc="" called"<<endl;="" its="" getting="" called="" not.......
if(="" umsg="=" wm_devicechange="" )
{
cout<<"device="" change"<<endl;
}
return="" defwindowproc(hwnd,umsg,wparam,lparam);="" call="" window="" api="" function="" defwindowproc()="" which
="" provides="" default="" message="" processing="" messages="" that="" were="" not="" processed="" by="" this="" window.
}
output="" is
0x290392="" hwnd
0x245d08="" hdevnotify
registration="" complete
0="" getlasterror()
and="" nothing="" is="" happening="" when="" inserting="" usb.....nyone="" knw="" about="" this
bye="" have="" a="" nice="" day.....
bye="" day.....=""
<div="" class="ForumSig">bye have a nice day.....
|
|
|
|
|
You seem to be directing the notification to send a WM_DEVICECHANGE message to a console window that you didn't create and have not sublcassed. It looks like the window receives the message and then ignores it because it has nothing to do with it...
A better idea would be to create your own top level window and add WM_DEVICECHANGE to the messages being handled on that window message loop.
See the MSDN documentation[^]
|
|
|
|
|
thanx for reply....
i know its not getting any message... coz i checked it with spy++.. its a software which checks all messages sent to a window by windows.... its showing a message send when im use winMain() istead of main().... also i dont want to create a gui.. i want this to run in background...and to receive the message i have created that windowProc() function but thats not getting called??? what to do???
bye have a nice day.....
|
|
|
|
|
Some applications have an invisible window so they can get WM messages...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|