|
You should provide some g_main_context_iteration to your question.
Since g_main_context_iteration (of the GLib library) is a C function , you are free to use it in your C++ application.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
the command is - while (g_main_context_iteration(NULL, false) == TRUE) {}
and i have problems using glib and i search for alternative
|
|
|
|
|
Well, GLib (I guess) has its own programming model that you won't find in other frameworks (or in bare Win32 development). What kind of application do you intend to develop?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Im Develop on Linux with QT IDE
im sorry i gave only a few details its only because its seems so clear to me
|
|
|
|
|
shiranraviv wrote: I want to wait for all the event to finish and only then continue my program
What's your query about? Some sort of a guessing contest?
I'd hazard a guess that WaitForSingleObject[^] is what you may be after...
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi to All,
Could anyone please tell me, how to implement the divide operation by using shift operator....
I know that, if we right shift by n..number will be divide by (2 to the power n)....But, what about other numbers?...(say 2*3)...please help me out
thanks in advance
-----------------------------
I am a beginner
|
|
|
|
|
If the divisor is not a power of two, the shift operator alone can't do the trick. You may, for instance mimic the divide operation you perform manually, porting it from base 10 to base 2 .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Oh Ok...thank you for your reply
-----------------------------
I am a beginner
|
|
|
|
|
Hi,
I'm trying to create a driver, for which I use WinDDK 7600.16385.0
But when I add a *.lib file, the linker still gives "unresolved external symbol" errors the same as if I haven't added it at all. I know the linker looks for the *.lib file, because I checked - I renamed the lib file to something else and the linker immediately complained that it can't find it. Does anyone here know what might be the problem?
I've referenced the lib file and the include files' dir in the sources file of the driver:
TARGETNAME=driver_drv
TARGETPATH=obj
TARGETTYPE=DYNLINK
TARGETLIBS=$(SDK_LIB_PATH)\winspool.lib \
$(SDK_LIB_PATH)\user32.lib \
$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\advapi32.lib \
$(DDK_LIB_PATH)\umpdddi.lib \
$(SDK_LIB_PATH)\comdlg32.lib \
$(SDK_LIB_PATH)\ntdll.lib \
$(SDK_LIB_PATH)\win32k.lib \
$(SDK_LIB_PATH)\gdi32.lib \
----> C:\MYLIB.LIB <---------------------------------------------- See here
USE_MSVCRT=1
USE_STL=1
USER_C_FLAGS=/EHsc
DLLDEF=driver.def
DLLORDER=driver.prf
DLLENTRY=_DllMainCRTStartup
INCLUDES=C:\MYLIB\Include <---------------------------------------------- See here
C_DEFINES=$(C_DEFINES) -DSTRICT -DUNICODE -D_UNICODE -DUMODE -DUSERMODE_DRIVER
C_DEFINES=$(C_DEFINES) -DWIN32 -D_CONSOLE -D_VISUALC_ -DNeedFunctionPrototypes -D_DLL
NTPROFILEINPUT=yes
MSC_WARNING_LEVEL=$(MSC_WARNING_LEVEL) /WX /W3
SOURCES=driver.cpp \
driver.rc
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Did you ever figure out how to use the WinDDK with MFC? If yes, I'd so much appreciate it if you could tell me your project settings!
|
|
|
|
|
Can't you just use win32 for whatever dialogs you need to show? You usually shouldn't embed any gui code inside a driver anyway. It works in XP but wait till you see how it behaves on Win7. There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I'm trying to create a DLL that links to the DDK, with a COM object as my interface to the DLL... Can this be done without MFC? (there are no dialogs at all)...
|
|
|
|
|
"with a COM object as my interface to the DLL"
Could you clarify this?
COM even can be made in plain C (not C++), so you certainly don't need MFC. MFC does offer some handy classes like COleDispatchDriver that make working with COM easier though. I think you can use ATL instead, which has alternative classes.There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
I need to create another project with its own import settings, so I thought a DLL would be my best bet, however I never understood how to properly export functions other than with COM. Using the "New Project" dialog in VC++, I thought my only option was to use "MFC DLL". You're saying otherwise though and that sure sounds good.
What type of project should I create? And how do I add my COM class to this project once it's created?
|
|
|
|
|
Am I getting this all wrong? I thought you wanted to make a driver, but now you talk about New Project with VC++,COM and etc., which has nothing to do with drivers. WinDDK isn't VC++, it's a framework for making drivers (like network/usb/printer/display drivers). Sorry, just have to make sure we're having the same thing in mind, otherwise we'd just confuse each other. There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Well not a driver, but a USB HID device - so sort of a driver? I've got this credit card reader that is a USBHID device - so you need to use the WinDDK. Here's my story - I actually got this working in VC++ 6.0 about 3 years ago and now I can't figure out how to setup my project anymore. But that's just what I did - I created a COM object and linked to the DDK (from VC++ 6.0). Now I've upgraded to VC++ 2008 and just want to take the best route - if I have to learn the right way of doing it along the way, BONUS! I'm all ears. Just because I got it working before doesn't mean it was the best way of doing it anyway - and just the same, I can't get my project linked with MFC.
Current project settings: (with errors below)
Use MFC in a Static Library
Not Using ATL
Additional include directories:
C:\WinDDK\7600.16385.0\inc
C:\WinDDK\7600.16385.0\inc\api
C:\WinDDK\7600.16385.0\inc\crt
C:\WinDDK\7600.16385.0\inc\mfc42
C:\WinDDK\7600.16385.0\inc\ddk
C:\WinDDK\7600.16385.0\inc\api\dao360
Ignore standard include path: No
Additional library directories:
C:\WinDDK\7600.16385.0\lib\wxp\i386
C:\WinDDK\7600.16385.0\lib\Mfc\i386
C:\WinDDK\7600.16385.0\lib\ATL\i386
Additional dependencies:
ntdll.lib
msvcrtd.lib
Errors:
1>Linking...
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/RELEASE' specification
1>LINK : warning LNK4075: ignoring '/DELAYLOAD' due to '/DRIVER' specification
1>MathHelper.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/DRIVER' specification
1> Creating library C:\dev\USBHIDCardReader\Debug\USBHIDCardReader.lib and object C:\dev\USBHIDCardReader\Debug\USBHIDCardReader.exp
1>LINK : error LNK2001: unresolved external symbol _DriverEntry
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
1>MathHelper.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
1>stdafx.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
1>StringHelper.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
1>USBHIDCardReader.obj : error LNK2001: unresolved external symbol __afxForceEXCLUDE
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol __afxForceUSRDLL
1>MathHelper.obj : error LNK2001: unresolved external symbol __afxForceUSRDLL
1>stdafx.obj : error LNK2001: unresolved external symbol __afxForceUSRDLL
1>StringHelper.obj : error LNK2001: unresolved external symbol __afxForceUSRDLL
1>USBHIDCardReader.obj : error LNK2001: unresolved external symbol __afxForceUSRDLL
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall CString::~CString(void)" (??1CString@@QAE@XZ) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,char,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HDH@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::~CString(void)" (??1CString@@QAE@XZ)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::~CString(void)" (??1CString@@QAE@XZ)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall CString::CString(class CString const &)" (??0CString@@QAE@ABV0@@Z) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,char,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HDH@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(class CString const &)" (??0CString@@QAE@ABV0@@Z)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(class CString const &)" (??0CString@@QAE@ABV0@@Z)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: void __cdecl CString::Format(char const *,...)" (?Format@CString@@QAAXPBDZZ) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,char,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HDH@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: void __cdecl CString::Format(char const *,...)" (?Format@CString@@QAAXPBDZZ)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: void __cdecl CString::Format(char const *,...)" (?Format@CString@@QAAXPBDZZ)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall CString::CString(void)" (??0CString@@QAE@XZ) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,char,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HDH@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(void)" (??0CString@@QAE@XZ)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(void)" (??0CString@@QAE@XZ)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: class CString const & __thiscall CString::operator+=(char)" (??YCString@@QAEABV0@D@Z) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,class CString,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HV2@H@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: class CString const & __thiscall CString::operator+=(char)" (??YCString@@QAEABV0@D@Z)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: class CString const & __thiscall CString::operator+=(char)" (??YCString@@QAEABV0@D@Z)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: int __thiscall CString::Find(char,int)const " (?Find@CString@@QBEHDH@Z) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,class CString,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HV2@H@Z)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: int __thiscall CString::GetLength(void)const " (?GetLength@CString@@QBEHXZ) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,class CString,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HV2@H@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: int __thiscall CString::GetLength(void)const " (?GetLength@CString@@QBEHXZ)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: int __thiscall CString::GetLength(void)const " (?GetLength@CString@@QBEHXZ)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall CString::CString(char const *)" (??0CString@@QAE@PBD@Z) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomString(int,class CString,int)" (?GenerateRandomString@CMathHelper@@SA?AVCString@@HV2@H@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(char const *)" (??0CString@@QAE@PBD@Z)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::CString(char const *)" (??0CString@@QAE@PBD@Z)
1>MathHelper.obj : error LNK2019: unresolved external symbol "public: class CString const & __thiscall CString::operator+=(class CString const &)" (??YCString@@QAEABV0@ABV0@@Z) referenced in function "public: static class CString __cdecl CMathHelper::GenerateRandomStringOfNumbers(int)" (?GenerateRandomStringOfNumbers@CMathHelper@@SA?AVCString@@H@Z)
1>StringHelper.obj : error LNK2001: unresolved external symbol "public: class CString const & __thiscall CString::operator+=(class CString const &)" (??YCString@@QAEABV0@ABV0@@Z)
1>StringHelper.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CStringArray::~CStringArray(void)" (??1CStringArray@@UAE@XZ) referenced in function "public: static class COleDateTime __cdecl CStringHelper::GetOleDateTimeFromMySQLString(class CString,int)" (?GetOleDateTimeFromMySQLString@CStringHelper@@SA?AVCOleDateTime@@VCString@@H@Z)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CStringArray::~CStringArray(void)" (??1CStringArray@@UAE@XZ)
1>StringHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall COleDateTime::COleDateTime(class COleDateTime const &)" (??0COleDateTime@@QAE@ABV0@@Z) referenced in function "public: static class COleDateTime __cdecl CStringHelper::GetOleDateTimeFromMySQLString(class CString,int)" (?GetOleDateTimeFromMySQLString@CStringHelper@@SA?AVCOleDateTime@@VCString@@H@Z)
1>StringHelper.obj : error LNK2019: unresolved external symbol "public: int __thiscall COleDateTime::SetTime(int,int,int)" (?SetTime@COleDateTime@@QAEHHHH@Z) referenced in function "public: static class COleDateTime __cdecl CStringHelper::GetOleDateTimeFromMySQLString(class CString,int)" (?GetOleDateTimeFromMySQLString@CStringHelper@@SA?AVCOleDateTime@@VCString@@H@Z)
1>StringHelper.obj : error LNK2019: unresolved external symbol "public: int __thiscall COleDateTime::SetDate(int,int,int)" (?SetDate@COleDateTime@@QAEHHHH@Z) referenced in function "public: static class COleDateTime __cdecl CStringHelper::GetOleDateTimeFromMySQLString(class CString,int)" (?GetOleDateTimeFromMySQLString@CStringHelper@@SA?AVCOleDateTime@@VCString@@H@Z)
1>StringHelper.obj : error LNK2019: unresolved external symbol "public: __thiscall CString::operator char const *(void)const " (??BCString@@QBEPBDXZ) referenced in function "public: static class COleDateTime __cdecl CStringHelper::GetOleDateTimeFromMySQLString(class CString,int)" (?GetOleDateTimeFromMySQLString@CStringHelper@@SA?AVCOleDateTime@@VCString@@H@Z)
1>USBHIDCrdRdrThread.obj : error LNK2001: unresolved external symbol "public: __thiscall CString::operator char const *(void)const " (??BCString@@QBEPBDXZ)
...............
|
|
|
|
|
Yes, I see now why you were talking about VC++. The thing is, WinDDK comes with its own compiler, which is 'annointed' (i.e. official and supported) by the DDK development team. WinDDK is intended to work with it. Now, that doesn't mean it won't work with other compilers - you've made it work with VC6, but that's not how it's intended (by microsoft) to be compiled. What I did was I used their official compiler which comes with WinDDK and is in fact in the directory (C:\WinDDK\bin or something). So if you really want to use VS2008 I can't be of much help because that's not how I did it. I used the WinDDK official compiler. See if this thread (http://www.osronline.com/showthread.cfm?link=151863) can help you, they talk about how to make it work with VS2008 there. There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi
I'm having a mfc dialog box application as a dll. I want to send any event (button press) in the dll to the application that calls the dll. how to do that. Anybody can please help me.
Thanks
Vijeesh T
Bangalore, NAL
|
|
|
|
|
May be you can pass the handle of the main window to the dll( in some initilization function ) and when button click occures you can send a message( RegisterWindowMessage() ) to the main dialogbox from the dll indicating the button press.
|
|
|
|
|
thanks. I could do by Inheritting the dll class and implementing the virtual function.
Thanks again
Vijeesh
|
|
|
|
|
Member 4599406 wrote: I want to send any event (button press) in the dll to the application that calls the dll.
What?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
He might have a dialog created with DoModal in the DLL, with all the code of the dialog in the DLL. Then he can't call directly to functions from the parent app (that has loaded the DLL).
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Why would the DLL ever need to know anything about the application that has loaded it?! Leave alone executing code from that.
But I'm still not sure of what the OP is trying to achieve and I'll leave it up to the OP to precisely explain the issue.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I'm a rookie to C and i'm looking for some libraries to learn,something likes the C++ STL or Boost ,does any1 can tell me some of them?Thanks a lot
Eric
|
|
|
|
|
You should learn STL[^] and Boost[^].
By the time you learn them, you will no longer be a rookie.
|
|
|
|