|
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.
|
|
|
|
|
|
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.
|
|
|
|
|
|
Hi everyone this is my first post so be gentle;)
How do you best share data between threads? For instance if you have two arrays and the main plus another thread has to have access to them what is then the best way to create the thread? As a worker or UI thread and what about parameters and so on? Of course one could do it with global vars but I dont like globals an I will do anything to avoid them
Any suggestions?
Tnx in advance
/Frank
|
|
|
|
|
You can give an pointer to the arrays, so the others thread can access the data. Dont ferget syncronization with Critical Section. A good idea is to work with Events.
Or you can send Messages between the threads.
|
|
|
|
|
If three threads [your primary thread + the two worker threads] are accessing the same array, then you'll be better off implementing some kind of data synchronization methods. Perhaps crictical sections would suite you well in this case. As for passing the data across threads, threads are usually passed an LPVOID parameter. You can pass a pointer to a struct that wraps all your shared arays. And this pointer can be passed to all your worker threads. But as I already said, you have to implement synchronization mechanisms else your data will get corrupted quite easily. And it won't be easy to debug as well.
Regards
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Buy it, read it and admire me
|
|
|
|
|
Tnx for the quick responce both of ya!
Got it then there is just one more qeustion
So I have to use a worker thread! Because of the LPVOID param right? Can you tell me why it not possible to do that in a UI thread...why is there no LPVOID param i the UI thread? (it dont make no sence to me)
Am I missing something here...
|
|
|
|