|
You could do something like this...
in the calling program
try {
int x = SomeProcedure();
...
}
catch (CMyException *e)
{
LogError(e->nMyErrorNum....
delete e;
}
int SomeProcedure()
{
n = new CMyClass();
if (!n) {
CMyException* pErr = new CMyException(TRUE);
pErr->errNum = ERRORNUMBERIWANTTOUSE;
throw pErr;
}
...
Define class CMyException
class CMyException : public CException {
int nMyErrorNum;
...
Hope this helps
|
|
|
|
|
Thanks for this advice...
Hello World!!!
from Raphaël
|
|
|
|
|
Toolbars position on parent size
I have a problem with the position of the toolbars. For a better discription, open wordpad. Dock the toolbars side by side so that they both are in the same row. Now resize the main frame window so that to reduce the size from the right side to the left. Reduce to the smallest possible horizontal width. Notice that the second toolbar that you docked on the right of the first one has moved down. Now resize to increase the size. Notice that the toolbar is NOT moved back to right of the first toolbar. i.e. to its original position before reducing size.
I need to reposition it when the size is increased. Also, I need the docking support on all sides of frame, dynamic size and dock state toggle on double click, so simple rebar cannot be used.
MS Office uses the msoCommandBar which does all the desired, but i cant use it as i dont have its class, control or documentation.
The environment I am using is Visual C++ 6.0 with sp5.
Any ideas how this can be done?
The "Best" is what you can never achieve.
|
|
|
|
|
I want to display the jpeg file in the window.How to do this.Is it possible to use load bitmap function.I tried to import the jpeg file,but when i import it is asking resource type.i dont know what to give the resource type.Can anyone tell me how to solve this.
|
|
|
|
|
|
I havent looked at the other suggestion. But I suspect this is a more modern solution. Check out http://msdn.microsoft.com/msdnmag/issues/01/10/c/c0110.asp, there is lots of useful stuff here aswell.
"Life begins at 140"
|
|
|
|
|
I am developing a mediaplayer by customising Windows Mediaplayer Control. The mediaplayer should have the ability to detect whether there is already an audio playback running on the Windows 98/2000. If there is one running, the mediaplayer should stop it and start to run its own.
I know there is a property in Mediaplayer control which is called AudioStream, the value of which has been set to -1 be default. But I don't know how to make use of it.
Any help are greatly appreciated.
DJ
|
|
|
|
|
Hi All,
I need to create a program that would first check whether a minimum password length has been set or not,if it is not set then the program would set the minimum password length.How do I solve this problem.
Thanks
Abhishek.
Learning is a never ending process of Life.
|
|
|
|
|
Try Netxxxxx APIs,Such as NetUserxxx,NetGroupxxx,sorry,I don't know clearly
I am seeking...
For what?
Why did you ask me for what? I don't know!
|
|
|
|
|
Thanks for the help.
Abhishek
Learning is a never ending process of Life.
|
|
|
|
|
For replace the Ctl+Alt+Del SAS, I wrote a dll name mygina.dll,and copy it to system directory, wrote registry just make it usable;and some trouble come!, for to debug, I wrote "DebugBreak()" before I want break, But when the windows boot up, I got a "need replace gina.dll" message,why? and how can I break the code and to debug it?
|
|
|
|
|
Is this supposed to be funny or what?
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
I just want debug my gina.dll, but if I put a debug version on system directory, I will get a dialog box that tell me "you need replace the gina.dll", and system hang up, only goto reboot.
I mean how can i debug the gina.dll?
|
|
|
|
|
Hi...
Can please someone help me...how do i want to open the compiled help file (*.chm) in VC++
Rgds
|
|
|
|
|
As far as i am aware you can't open CHMs in visual studio. Use Microsoft HTML Help Workshop, or help authoring tool such as HyperText Studio or RoboHelp.
Dave
|
|
|
|
|
I know that we can open it using the HTML workshop...how i want to called it in the VC++ application
|
|
|
|
|
The HtmlHelp() API function works well for me.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
The Htmlhelp api will Do the job but dont ferget to #define the IDs in the HMTL workshop.
|
|
|
|
|
find out this function in the msdn this will tell you what you have to do for opening chm file.
HtmlHelp(NULL, "My_chm.chm::/A_topic.htm", HH_DISPLAY_TOPIC, 0);
if there is any problem then mail me at gupshuptime@hotmail.com
lodhi
|
|
|
|
|
ComboBox - turning OFF autocomplete in CE... in Windows CE (VC++ 3.0, Pocket PC 2000) the combo boxes do autocomplete (it looks up the first string with the same first char you type in, then fills the edit box with that whole string). THIS IS VERY ANNOYING in CE, especially when trying to use the soft-keyboard to actually enter or EDIT a new string in it's edit box. One beta tester nearly left the room in a rage because she couldn't figure out how to "beat the system". Ugh...
Any Hints? Anyone? Beuller?
Carlos
|
|
|
|
|
Hmm. I left my pda with the testers today, but as far as I remeber, CComboBox'es doesnt automatically do autocomplete in the edit box, they do it in the small popup window over the SIP. Maybe this is a feature in your program, or maybe Im just remembering it wrong?
Anyway, to disable the autocompletion that the SIP offers (handy on PPC 2000's since they do it for editboxes with ES_PASSWORD too) do this:
<br />
SIPINFO info;<br />
SHSipInfo(SPI_GETSIPINFO, 0, &info, 0);<br />
info.fdwFlags |= SIPF_DISABLECOMPLETION;<br />
SHSipInfo(SPI_SETSIPINFO, 0, &info, 0);<br />
SHSipPreference(m_hWnd, SIP_FORCEDOWN);<br />
SHSipPreference(m_hWnd, SIP_UP);<br />
And to turn it back on:
SIPINFO info;<br />
SHSipInfo(SPI_GETSIPINFO, 0, &info, 0);<br />
info.fdwFlags &= ~SIPF_DISABLECOMPLETION;<br />
SHSipInfo(SPI_SETSIPINFO, 0, &info, 0);
“Our solar system is Jupiter and a bunch of junk” - Charley Lineweaver 2002
|
|
|
|
|
I need a C/C++ program able to detect some peculiarity of the PC (as
the number of the partitions of the hard disk, the number and the label
of the disk C, ecc.) if it is possible without calling the "system"
statement (calling the "system" statement I see alwais the DOS window).
Can you help me ????? - I work with Visual C++ compiler.
Many thanks - Giovanni
|
|
|
|
|
This depends on your target OS.
For both Win9x and NT-kernel based Win32 implementations you can:
To get the drive letters mapped:
GetLogicalDrives() and/or GetLogicalDriveStrings().
To get the label of a volume (note: there is no label for a disk) you can use GetVolumeInformation().
For NT only you can get disk information (partitions and so on) using DeviceIoControl() with e.g. IOCTL_DISK_GET_DRIVE_LAYOUT.
To get the same info from Win9x I believe you have to resort to BCB (DOS, anno 1982) and 16-bit code, but I might be wrong.
If you want to get the GUID's of volumes (introduced in NT5) you can get to them using NT5+ only API's such as FindFirstVolume.
Also, there is no C or C++ "statement" called "system". system() is a C library function.
++luck;
|
|
|
|
|
i need to select a tree item by coding:
CTreeCtrl::SelectItem(hItem);
if hItem is invisible (scroolled out of view range), system auto scrolls the item into view range.
but i don't want to scroll the item.
so, how to call CTreeCtrl::SelectItem(hItem) or other function but not scroll hItem?
thx
includeh10
|
|
|
|
|
Have you tried setting the state directly by:
CTreeCtrl::SetItemState( hItem, TVIS_SELECTED, TVIS_SELECTED );
Dave
|
|
|
|