|
Yes, UpdateWindow() causes Windows to send a WM_PAINT message to an invalidated window, while Invalidate() cause WM_PAINT to be posted. I use UpdateWindow() to force a repaint when I can't afford to wait for the posted WM_PAINT to eventually arrive. It probably doesn't make a difference in your demo app.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Hi
How can i associate a file extension with my app?
i want that all double clicks will will open the files in the same instance of my app.
thanks
|
|
|
|
|
Anonymous wrote:
How can i associate a file extension with my app?
If this is an SDI app, you can use these lines of code in the InitInstance:-
EnableShellOpen();
RegisterShellFileTypes(TRUE);
m_pMainWnd->DragAcceptFiles(); //for drag/drop support
Anonymous wrote:
want that all double clicks will will open the files in the same instance of my app.
For this you need to use a mutex to prevent multiple instances. You check if the prog is already running and if it is already running [search for it using window title/class name] post a WM_COPYDATA message to it passing the command line.
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
There's an article by Joseph Newcomer that describes how to limit your app to one instance.
In the C++/MFC section, it's called "Avoiding Multiple Instances of an Application".
No generalization is 100% true.
Not even this one.
|
|
|
|
|
Nish - Native CPian wrote:
How can i associate a file extension with my app?
If this is an SDI app, you can use these lines of code in the InitInstance:-
EnableShellOpen();
RegisterShellFileTypes(TRUE);
m_pMainWnd->DragAcceptFiles(); //for drag/drop support
What if I have a dialog-based app? Since I don't have the doc-view framework, AddDocTemplate() doesn't work.
Thanks!
|
|
|
|
|
Does anyone know of any website that contain tutorials for a beginner to learn opengl?
==================================================
Homepage: www.onyeyiri.co.uk
Email: theeclypse@hotmail.com
"I think Microsoft has invented A.I. My computer has a mind of its own!"
|
|
|
|
|
Try www.codeproject.com in the tutorial area
~RaGE();
|
|
|
|
|
http://nehe.gamedev.net/
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
|
And, of course, the beginners coding forum at opengl.org. ![Smile | :)](https://codeproject.global.ssl.fastly.net/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
|
Hello
I have a CBitmap object.
It's a member of a class.
The user can call a function to load a bitmap into this CBitmap object.
Now I have another function where I use the CBitmap object.
Here I would not know whether the user has actually loaded the bitmap or not.
So can I use this code to check if the CBitmap object has a valid bitmap in it?
if(!m_bitmap.m_hObject)
MessageBox("No bitmap found");
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
That code looks fine Nish.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Roger Allen wrote:
That code looks fine Nish.
Thanks Riga, I am totally new at all this GDI stuff
But after converting that MSP thing to BMP this week, I am suddenly interested in GDI
Nish
p.s. GDI coding is highly leak-prone I think, for newbies anyway!
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
Here is an artical which you may find useful on the subject:
http://www.codeproject.com/gdi/csavedc.asp
If you havn't read it already.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
Does anyone know if it's possible to make dxdiag (the directx diagnostics tool), to lauch silently and dump its output to a given file (i.e. from the command line)
This is so that I can make an app automatically dump the system info of our users machines onto a network drive, which would simplify many support problems greatly (as many things have been down to not having the right graphics / directx version or having an old rubbish graphics card)
[I know I can ask them to manually run dxdiag and mail me the results, but I prefer something that is totally transparent, and would allow me to check the details the moment I'm told of a problem]
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
I need link the user.exe library with visual c++, I have attempt it with the LoadLibrary but it doesn´t work. I have found another function that it is LoadLibraryEx but I´m not sure that it work.This library is to use the serial port.
Thanks in advance.
Please, I need help
¡¡Cuñaaaooo!!
|
|
|
|
|
user.exe? Or do you mean user32.dll? I have this vague remembrance that user.exe is a leftover from the 16 bit days. I reckon you should be using user32.dll. For that you can link with user32.lib
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
Whenever I put "#define _UNICODE" in my project I get linker error:
msvcrtd.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/strtest.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Any help appreciated.
|
|
|
|
|
|
mfc unicode applications use wWinMainCRTStartup as the entry point rather than WinMain. Change it in the link / output options the project settings.
|
|
|
|
|
Ok I modified the program entry point and now it linked. But I got another problem, that if I use some foreign characters in a CString and I want to output certain characters of that CString, it won't work. My code looks like this:
CString str = _T("ÎÒÃÇ");
CFile fo;
fo.Open(_T("test.txt"), CFile::modeCreate | CFile::modeWrite);
TCHAR ch = str[0];
fo.Write(&ch, sizeof(TCHAR));
fo.Close();
And the character cannot be output correctly. What am I doing wrong? Thank you.
|
|
|
|
|
I have a Win32 Dll containing some functions for which I know the signature. But none of the functions in the dll are exported.
Is it possible to call them using GetProcAddress.. is it necessary that inorder to call a fn inside a dll it must be exported.
I just told to my friend that it must be possible, but have never tried.
Thanks
Kannan
|
|
|
|
|
Kannan Kalyanaraman wrote:
Is it possible to call them using GetProcAddress..
No.
is it necessary that inorder to call a fn inside a dll it must be exported.
No, it can be a virtual member function of a class that resides in the DLL. Bot for ordinary functions you must export the symbol.
|
|
|
|
|