hInstance parameter (first one) from LoadBitmap should be the instance of the module that contains the bitmap . In your case your application. You can use it as NULL only for predefined bitmaps like OBM_CLOSE. Regrads, /REMUS
Remus Lazar
Posts
-
Bitmap Display Problems -
How to catch keyboard and mouse events of all windows?Usualy you must obtain messages from windows and you could do this by "subclassing" every process. For more informations read in MSDN.(try a serch using "Subclassing Windows" and you will find some TehnicalArticles usefull enough about this) regards, /REMUS
-
SendKeysYes you should use SendMessage or PostMessage Something like SendMessage(h_yourWnd,WM_KEYDOWN,...) you should chek help for WM_KEYDOWN message to get info about parameters regards, /REMUS
-
Modeless dialogUsually disapears because the scope of variable swRem is finished. The best way is the first solution and on WM_CLOSE message (should be more) try a "delete this" It should work. regards, /REMUS
-
Hiding the Menu in a MFC ApplicationRead MSDN for CDocTemplate CSingleDocTemplate CM.... maybe you will find a hint /REMUS
-
Problem in the release exeHi, Usually the problems appear so frequently from 2 resons. If you use MFC and modify the prototype of message handlers like ON_MESSAGE(WM_WHATEVER,OnWhatever) .... OnWhatever has prototype LRESULT OnWhatever(WPARAM,LPARAM) otherwise you get your crash... Other reason is uninitialized mebers. Normaly to avoid such situations you should add for each members default values and so on. By the way to debug it in release version use for your project settings at c/C++ tab page for debug info -> Program database , for optimizations -> Disable Debug and in Link tab check the generate debug info check box. And now you have debug info in release!! Try to get them with Bug Trapper from www.mutek.com I whish you luck and patience, /REMUS
-
C++ ExceptionHi, Try this one catch(CException e) //i'm not sure if is pointer of not { TCHAR szCause[MAX_PATH]; szCause[0]=0x00; e.GetErrorMessage(szCause,sizeof(szCause));// } But the best way is to read CopyConstructor help for CString because the exception types are defined there. Best regards, /REMUS
-
How to register my program into the startupIn registry at [HKEY_LOCAL_MACHINE]\Software\Microsoft\Windows\CurrentVersio\Run\ Add a string value ... Look at the entry that are already exists. Doesn't matter windows version /REMUS
-
AddItem-method for MSHFlexGrid 6.0The method should describe the variant type For example if you need a BSTR as variant type you need for second parameter CString strString = "Your Text"; VARIANT va; VariantInit(&va); va.vt = VT_BSTR; va.bstrVal = strString.AllocSysString(); Object.AddItem("Whatever",&va); For other type of variant initialze proper memeber of VARIANT . vt memeber will descibe what member will be used and you will initialize that one (could be more) Best regards, /REMUS
-
CAsyncSocket-debug assertion failedTry something like this closesocket(m_hSocket) where m_hSocket is data member from CAsyncSocket.
-
disable resizeTry to read help for function SetWindowPos you have a flag named SWP_NOSIZE /REMUS
-
need help with PJNaughter's CSerialPort classHi, I don't know exactly how the class looks like but you must have some function to notify you when an event occured. Should be somenthing like "WaitForEvent" with some parameters (event mask and timeout). You must wait until an event like CHAR_RECEIVED occures or timeout expires .. Something like that. General flow is something like this: Without handshake : - if you don't locate this kind of function to do the job for you try this : read the port with timeout and if char received is TIMEOU_CHAR or something like this -> you didn't receive something and try again, when first valid char occures you start to construct your message. Use this on thread and be carefully with your time out values.You should have some predifined types for TIMEOUT_CHAR. To send is much more easier, just send it. with handshake : - RTS/CTS, DTR/DTS or XON/XOFF you should read the protocols first and you should find functions to acces this signals from comm port. But the genereal flow is the same. This signals helps you to know when you can send something via serial port (if device is occupied and cannot receive will raise the CTS signal ..... ). i hope it's helpfull for you.
-
Need source for WSAAsyncGetHostByAddr()Hi, I hope is usefull to you: Add this lines bellow in your InitInstance method of your application and you can use any WSA.. function . WSADATA wsa; WSAStartup(0x0101, &wsa); in ExitInstance(): WSACleanup(); and #include in your stdafx.h file also you must link your application with wsock32.lib It doesn't matter if your application is build with or without MFC Best Regards, /REMUS