|
thnx Blake and GopalKrihna u have resolve my problem
|
|
|
|
|
hi,
i have code that gets pointers to all the open documents (CDocument objects) in the application. i was wondering how i can check if the document is currently closing when i get the pointer to it. any help would be appreciated, thank you.
jay
|
|
|
|
|
Hi,
There is no direct mechanism to do this. Create your own class which is derived from CDocument and override this method.
virtual void OnCloseDocument( );
Thanks & Regards,
Gopalakrishnan
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
I would suggest to make it by setting a flag, member of CDocument (eg. bool closing ), at the beginning of your OnCloseDocument override and unsetting it at the end of the function.
|
|
|
|
|
Hi,
I have a stream of data coming in over the USB bus from a device which I have made. The data is basically a colour value for each pixel. I need to display this data in real time.
I'm currently using a double buffering method.I have a bitmap attached to a background DC where I use the MFC CDC::SetPixel command to set each pixel on the bitmap. The bitmap is then stretched using the StretchBlt function and then finally transfered to the foreground DC with BitBlt.
The problem with this method is I'm still getting some flicker even though I'm using a a double buffer. I'm basically trying to look into other methods that may be faster.
I was thinking of using a video streaming class.There is quite a bit of information available for displaying video streams but I'm not sure how to turn my raw data into a standard video stream.
Any help/advice on things to try would be much appreciated.
Thanks,
Ryan
|
|
|
|
|
I've always been curious about databases in general. I have developed code using ADO, DAO, etc. but if I were to design a database from scratch I wouldn't know from where to start. I am not really planning on designing my own databases but I'd just like to have some basic understanding on how they work. Like what kind of structures would you use, and what kind of file formats, etc. Would anyone be able to provide me with some links or articles that provide simple explanations on databases? I am not looking for advanced concepts. Just the basics, so that I can get some exposure to the file structures. And I am not really willing to read books on the subject. I have been running searches on Google but I haven't found anything yet.
Time is the fire in which we burn.
|
|
|
|
|
|
Great! Thank you SO much! This is very helpful.
What about any articles that would provide some kind of background on databases?
|
|
|
|
|
Hi.
I created a application for which the main window is a modeless dialog.
This dialog has a child modeless dialog wich contains 2 buttons.
I'm able to TAB around the controls, passing from the parent dialog's
control to the child's ones as expected.
However, when the focus is on one of the child buttons and I hit the
ENTER key, it is the parent dialog that receive the WM_COMMAND message.
What is strange is that if I hit SPACE_BAR (wich simulate a mouse
click) instead of ENTER, my child dialog is correctly notified.
Here is my main loop :
while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0)
{
if (bRet == -1)
{
throw runtime_error("Fatal Message Error");
}
else
{
HWND hWnd = GetActiveWindow();
if (!TranslateAccelerator(hWnd, roDatabase.s_hAcceleratorTable,
&msg))
{
if ((hWnd == NULL) || !IsDialogMessage(hWnd, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
}
Anyone have had this bug??? Anyone have resolved it???
Thanks.
JF
|
|
|
|
|
There is some extra coding that you have to do to make this work with a modeless dialog.
You first need to set a WH_GETMESSAGE hook in the dialogs WndProc for WM_INITDIALOG. You hook proc will look something like this:
LRESULT CALLBACK GetMessageProc( int nCode, WPARAM wParam, LPARAM lParam )<br />
{<br />
LPMSG lpMsg = (LPMSG)lParam;<br />
<br />
if( (nCode >= 0) && wParam == PM_REMOVE &&<br />
(lpMsg->message >= WM_KEYFIRST && lpMsg->message <= WM_KEYLAST) )<br />
{<br />
if( IsWindow( lpMsg->hwnd ) && IsDialogMessage( g_hWnd, lpMsg ) )<br />
{<br />
<br />
lpMsg->hwnd = NULL;<br />
lpMsg->message = WM_NULL;<br />
lpMsg->lParam = 0L;<br />
lpMsg->wParam = 0;<br />
}<br />
}<br />
<br />
return ( CallNextHookEx( g_hHook, nCode, wParam, lParam ) );<br />
}
I hope this helps.
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
Hi All,
I'm trying to directly extract the RTF portion of a file saved using (in part) CRichEditDoc::Serialize(), by scanning through the file for {\rtf, then copying data until I reach the final }.
I'm finding strange things in the data though - some text blocks are repeated, and I'm wondering if it has saved the data in a partially-edited state, i.e. edits made by the user have been reflected visually in the rich edit view, but haven't actually been fully applied to the underlying RTF text.
Any idea if (1) I'm on the right track, and (2) how to fix the loaded data?
Cheers,
Steve.
|
|
|
|
|
Hi,
I am trying to pInvoke a vc++ dll from c#, the c# code
try to pass an integer into the dll and change
the global variable declared in the c++ dll, but it failed.
The global variable (int) changed inside the c++ procedure called by
the c#, but once the program run outside the procedure, the global
variable restore to its original value, why ?
And how can I change the global variable declared in the c++ dll when pinvoke by c# ?
Thanks
|
|
|
|
|
Hi..
I am getting the following message everytime i built the exe file..
Sometimes it comes as an error.. After doing "Rebuild All" again it works fine.. What must be the problem?
Linking...
LINK : LNK6004: Debug/PhoneAdapter.exe not found or not built by the last incremental link; performing full link
PhoneAdapter.exe - 0 error(s), 0 warning(s)
--------------
regards
pallavi
|
|
|
|
|
Its not an error, but information given to you by the linker to say that incremental linking was not possible.
For example, I often the incremental linking option switched on in my project to reduce the time spent on compilation. If I deleted the exe, by moving it to another location, then the linker will have to create the file from scratch.
Nothing to worry about, but you need to understand why it is happening.
I Dream of Absolute Zero
|
|
|
|
|
Thank you RChin..
Even i had the incremental linking option set.. and i didn't delete the exe also.
regards
pal
|
|
|
|
|
I have found that sometimes it will do a full rebuild if your codebase has changed drastically, or there where modifications in the code that would prove difficult for the compiler to reliably perform an incremental link.
I Dream of Absolute Zero
|
|
|
|
|
Ok.. you are right.. I added some classes to my project..
Thank you
pallavi
|
|
|
|
|
Hi Pal,
Just Clean you Solution/Project file by selecting BUILD|Clean Option.
Then Recompile/Rebuild the Solution to get your phoneAdapter.exe
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi Alok..
Ya.. I did that.. and its working fine now.. Thank you..
regards
pal
|
|
|
|
|
mpallavi wrote:
Thank you..
As Usual, Mention Not .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I am a novice programmer in VC++.I want to create an application in which i want to capture the menu events e.g in notepad when some user press file -> save / file-> print i got notified. How can i do the same.
Sunil Virmani
|
|
|
|
|
Sunil Virmani,
When you design a menu using RC editor or if you create a menu item dynamically, it will have a window ID which is uniquly used to find out which control generates that event. Suppose if you have a menu item ID_FILE_SAVE it will have a interger value. This integer value is passed with the LOWORD of wParam.
-- If you use MFC , you can use ON_UPDATE_COMMAND_UI macro. The corresponding handler will be called/notified when there is an event.
-- If you want to process the message, you can use ON_COMMAND(id,memberFxn ); macro. IT will call appropriate handler.
-- In case if you use Win32 SDK, you have to use switch case..
switch(msgType)
{
case WM_COMMAND:
if (LOWORD(lParam)) == ID_FILE_PRINT)
{
//.. do your process here
}
}
Thanks & Regards,
Gopalakrishnan
" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "
- Words from Nelson Mandela
Thanks & Regards,
Gopalakrishnan
|
|
|
|
|
I want to capture the events of the existing applications. I mean i want that i get notified when some one presses File->Save in notepad i get notified.
Regards,
Sunil Virmani
|
|
|
|
|
I wish to write a program to get the number of bytes/packets being received / sent over an NIC (standard ethernet card). Are there any inbuilt functions / libraries in the standard c/c++ library to this? If not, are there any external libraries to do so?
Nikhil
|
|
|
|
|
Nikhil Wason wrote:
Are there any inbuilt functions / libraries in the standard c/c++ library to this?
Yes, loop for IpHelper Api's
Nikhil Wason wrote:
are there any external libraries to do so?
Sure, here it is http://www.winpcap.org/[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|