|
NewHSKid wrote:
Did I do something wrong by asking the question yesterday and today? is that why you put the link to my question yesterday? If so, sorry.
No, I was just making you aware that a previous attempt was made to point you in the right direction.
NewHSKid wrote:
Can you explain a little more for me? What do you mean that the messages belong to the document? What is serialization?
I'm guessing that you have either an MDI or an SDI application. If that's the case, it's bound to have a CDocument -derived class. That class will have member variables, which might (it's up to you to decide the most appropriate spot) include the messages you are creating/sending/receiving.
Serialization is well-documented in MSDN (this tool should become part of your arsenal). Here's an excerpt:
“Serialization” is the process of writing or reading an object to or from a persistent storage medium, such as a disk file. MFC supplies built-in support for serialization in the class CObject. Thus, all classes derived from CObject can take advantage of CObject’s serialization protocol.
The basic idea of serialization is that an object should be able to write its current state, usually indicated by the value of its member variables, to persistent storage.
|
|
|
|
|
Thanks for the help....I am reading your tutorial now Ravi.
David, I am sorry, I didn't know where to go with the help i got yesterday. i thought maybe i would get someone to shed some light on how to understand it.
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
The MSDN Scribble example goes a long way in showing the many facets of an MFC application. I suggest you study it in detail.
|
|
|
|
|
Hi people!
I´m starting with GDI+ , so I discovered that I have to lead too much with
the WCHAR type . I´ve got some problems trying to compose a string (using sprintf ) and drawing the resulting text using Graphics::DrawString() (I couldn´t convert a char *string to WCHAR).
Do you know a way to make this convertion , or to compose a WCHAR string just like using sprintf?
Thank you !
|
|
|
|
|
Check out A2W() , MultiByteToWideChar() and related functions.
|
|
|
|
|
Dear All,
I am developing an application in MFC VC++ Version 6.0 for Windows 2000.
I have some contents in a batch file to uninstall my driver.
I need to uninstall the driver without using this batch file, i need to uninstall it from my application only on click of an event. Can any body please tell me API to uninstall the driver using the contents of the batch file
The contents of batch file are:
rundll32.exe setupapi,InstallHinfSection DefaultUninstall 132 .\filespyw2k.inf
I tried using Winexec like
WinExec("rundll32.exe setupapi,InstallHinfSection DefaultUninstall 132 .\filespyw2k.inf",SW_SHOW);
but it showed that installation failed. If i run the batch file it easily uninstalls the driver
Feel free to ask any further queries in this regards,
Thanks
Rohit Dhamija
|
|
|
|
|
It's just a guess but the InstallHinfSection() appears to have the following signature:
void InstallHinfSection( LPCSTR, UINT, LPCSTR );
If that's indeed the case, you could do something like:
hLibrary = Loadlibrary("setupapi.dll");<br />
pFunc = GetProcAddress(hLibrary, "InstallHinfSection");<br />
(*pFunc)("DefaultUninstall", 132, ".\\filespyw2k.inf");<br />
FreeLibrary(hLibrary);
Or you could just call CreateProcess() using the name of the .bat file.
|
|
|
|
|
dear sir,
void InstallHinfSection( LPCSTR, UINT, LPCSTR );
Can you please tell something more about it ?
rohit
|
|
|
|
|
My original hypothesis was wrong. It's a documented function.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/setupapi/setup/installhinfsection.asp
Now you can just link with setupapi.lib and call the function like you do any others.
|
|
|
|
|
Dear David,
I wrote following code, but it is throwing 4 errors
//////////
#include "Setupapi.h"
void main()
{
InstallHinfSection(NULL,NULL,TEXT("DefaultUninstall 132 .\filespyw2k.inf"),0);
}
////////
I am sending the errors also. Can you please help me ??
Thanks in advance
Rohit
The errors are:
--------------------Configuration: p - Win32 Debug--------------------
Compiling...
ss.cpp
c:\program files\microsoft visual studio\vc98\include\setupapi.h(37) : error C2143: syntax error : missing ';' before '*'
c:\program files\microsoft visual studio\vc98\include\setupapi.h(37) : error C2501: 'LPGUID' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\commctrl.h(26) : error C2146: syntax error : missing ';' before identifier 'HRESULT'
c:\program files\microsoft visual studio\vc98\include\commctrl.h(26) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
p.exe - 4 error(s), 0 warning(s)
|
|
|
|
|
Having just #include "Setupapi.h" is not enough for a complete, working program. For a Windows program, you'll need #include <windows.h> , too.
This setupapi.h file assumes the presence of other .h files. For example, line 37 is trying to create a new type (*LPGUID) based on an existing type (GUID). If no other .h files have been included that define GUID, a compiler error is just around the corner.
|
|
|
|
|
I think David means
#include <windows.h>
is required too, before the include of SetupAPI. (I hate it when I forget to tick the "Do not treat <'s as HTML tags" box too!)
<b>S</b><i>teve </i><b>S</b>
|
|
|
|
|
Hi all,
I am trying to convert MS DOC file to tiff file. How to do this?.I need to build the application on my own and not rely on third party applications.
Thanks in Advance,
Saravanan.
Its Always the Root that helps to Nurture Fruits.The Root is 'C'.
|
|
|
|
|
I'm not quite sure I understand the requirements here. Why do you want to convert a DOC file to a TIFF file? One is an image format and the other is not. Word itself does not even have provisions for saving as TIFF.
|
|
|
|
|
Macca,
Dialogic fax boards supports only tiff formats. So I want to convert doc and excel stuffs to tiff/f format. Hope now you got it right.
|
|
|
|
|
These don't directly answer your question, but I'll provide them just in case:
http://www.eprintdriver.com/to_tiff/DOC-to-TIFF-ex.html
http://www.leadtools.com/Utilities/PrinterDriver/ePrint_Formats.htm
http://www.meta-soft.com/
http://remotesensing.org/lists/libtiff_archive/msg01598.html
http://www.print-driver.com/howto/word_doc.htm
|
|
|
|
|
Hi all,
As beginner i have, i'm sure, a very simple problem;). How can i use a DblClick in a CEdit control. I have try use WN_DBLCLICK message in the CDialog parent without success .
Thanks for your help.
Best Regards
Olivier JOLY
|
|
|
|
|
One solution is to add a message handler for WM_LBUTTONDBCLK and determine if the mouse coordinate is inside of the control via PtInRect().
Kuphryn
|
|
|
|
|
To handle the double-click, you need to know if the control is supporting notification, which for EDIT controls would be EN_xxxx. There's no DBLCLICK for that, so you will have to derive your own class from CEdit and add a WM_LBUTTONDBLCLK handler in there. You can do whatever processing you need in there, or alternatively, send or post a message to the parent window, which would be the CDialog.
Steve S
|
|
|
|
|
Hi !
We are using Visual Studio 6 and FreeCVS.
I've noticed that some cpp files (which I didn't create) have a header which seems to be automatically updated with the file path and file version. The text line displaying these informations starts with a $Header.
I tried to do the same for my own cpp files, but couldn't make it work.
Could anyone tell me how to do that ?
Thanks !
Jerome
|
|
|
|
|
FreeCVS is expanding the $Header when you get files from it.
It won't work unless your cpp files are also managed by FreeCVS.
Most SCM tools have a similar facility.
Steve S
|
|
|
|
|
Does anyone know of a function to get DPI of the monitor?
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
I think you shoudl use GetDeviceCaps on the screen device context:
<br />
HDC screen = ::GetDC(0);<br />
double dftScaleX = 1;<br />
double dftScaleY = 1;<br />
dftScaleX = GetDeviceCaps(screen, LOGPIXELSX);<br />
dftScaleY = GetDeviceCaps(screen, LOGPIXELSY);<br />
::ReleaseDC(theHandleOfThisWindows, screen);<br />
|
|
|
|
|
thank you.
I had tested the API before. This will only return the DPI used by windows to display the font for example the menu fonts, shortcuts and etc. There are ony 120 or 96 as options.
My intention is to get the DPI use by the window to display all the items in the windows. All the elements on the screen.
For instance. This is extracted from www.shortcourses.com
Monitor size
Resolution 14" 15"
640x480 60 DPI 57 DPI
800x600 74 DPI 71 DPI
1024x768 95 DPI 91 DPI
Anyway, suppose I am able to get the resolution. How should I get the monitor size by API?
thanks
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Sorry, I don't know how to get the monitor size via API. I am not sure if you can do this. Did you try to use the options HORZSIZE/VERTSIZE of GetDeviceCaps?
There is an article in MSDN which describes how to write high-DPI applications. You may find some information in this article which are useful for you.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dngdi/html/highdpiapp.asp
How to Write High-DPI Applications
Nick Kramer
Microsoft Corporation
March 2001
|
|
|
|