|
I'm not sure i fully understand.
Basically you want a toolbar with graphical images...?
Use the appwizard and change toolbar bitmap using resource editor
However if you want to dynamically load bitmap(*.bmp) files and draw them manually divided into 4 quadrants.
Use LoadImage and the BitBlt function
have a day!
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
Hey guys,
I'm going through a debugging phase here, and I'm getting some access violation exceptions in my code. The problem is that these only happen in the release build. In the release build, the timing is a little different, and so with a multithreaded app, different synchronization scenarios show up.
I've used try catch handlers and an error log to trap exactly where the exception is happening. Grrr I just can't figure out how. Perhaps I'm trampling memory somewhere else?
Does anyone have any nifty release build debugging tricks I could try? This is driving me nuts!
Thanks!
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Well, the first trick is to enable debugging information in your release build. This has to be done for both the C compiler settings and the linker. This will at least allow you to see the crash in the debugger or maybe even step through the program.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
That's genius! I didn't think that was possible under release!
Thanks.
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Unfortunately, stepping through the program in release mode is very screwy. I don't even know what to believe anymore. The this pointer keeps changing even where it's not supposed to, and in general the addresses of all the local variables and object data members keep dancing around... Damn! Well, I'll keep trying...
Swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Make a MAP file (project settings - Link - General - Generate mapfile). That shows the address that each function begins at. When you get a crash, take the address and compare it against the ones in the map file. That should be enough info to tell you which function the crash happened in.
--Mike--
"COM didn't solve the old version of DLL hell - it just provided us with a new and improved version of hell."
-- John Simmons, 1/22/2002
My really out-of-date homepage
Sonork - 100.10414 AcidHelm
Big fan of Alyson Hannigan.
|
|
|
|
|
Thanks! Unfortunately, this hasn't gotten me much father... I've already narrowed down the problem with the try / catch's and so I know where it is happening. Any ideas how to figure out if I'm somehow trampling over memory? Or maybe another thread is trampling over this memory?
Thanks again,
swine
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
I had a problem with a multithreaded server I'm writing where I was using WSAEnumProtocols and the return buffer kept overwriting a lot of the other variables I had declared previously. It was changing pointer information to point to invalid areas of memory.
The only way to resolve it was by using GlobalAlloc on the variable, this was because instead of returning a variable with one instance it was returning an array. It took me forever to figure that out because PSDK would describe an array with everything else, besides just saying 'array'
HomeNuke
----
"Nuke'd Your Home, Yet?"
Run your own PostNuke based web server from home
http://www.homenuke.com
|
|
|
|
|
I sympathize, but unfortunately this doesn't help much
Cheers,
swinefeaster
Check out Aephid Photokeeper, the powerful digital
photo album solution at www.aephid.com.
|
|
|
|
|
Hi,
I have some problems regarding the version that MSDN gives and what my debug session returns to me!
I have installed WTL and the settings is set for WTL
What else is needed, there are things that just does not work as they should, for instance WM_NOTIFY
What is the correct settings to get WTL working in Visual studio that is?
I debug programs but they do not give me the answer that MSDN documentation says
Kindst regards Ulf
|
|
|
|
|
Can you use CDONTS.NewMail in a C++ program? I would certainly think you could, but I can't find any documentation for C++, just VB and ASP, etc. Can anyone point me towards a sample in C++ that instantiates a COM object and calls it? If you haven't already guessed, I'm new to C++.
|
|
|
|
|
You can use this class to send email. It's not CDONTS, but it works.
Jon Sagara
What about ?
|
|
|
|
|
I am trying to calculate the elapsed time that occurs while a program in running. I need the time in milliseconds, can anyone help me.
|
|
|
|
|
Depending on how long your program runs, ::GetTickCount () should be good enough.
DWORD dwStart = ::GetTickCount ();
... do work ...
DWORD dwEnd = ::GetTickCount ();
printf ("Elapsed = %d", dwEnd - dwStart);
Now, if you program is only going to be running for a few seconds then GetTickCount might not be good enough. Then you have to use the miltimedia timers.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
|
I have been trying to get the attributes from some XML all day!! Im slowly going mad! I have an XML file:-
//snip
<date name="12.12.3.98">12.56
//snip
I then have the following code. m_pCurrent is a node. I simply try and extract the attribute called name. Line 2 below works (unless i change the name of retrieval field - so I guess something is working) but when I try to access the value it just crashes with illegal access error... I have tried get_text, get_nodeValue etc etc.
m_pCurrent->get_attributes( &pNodeMap );
pScratchNode = pNodeMap->getNamedItem("name");
pScratchNode->get_text( &str );
AfxMessageBox( CString( str ) );
Thanks in advance
Ben
|
|
|
|
|
|
These are COM methods they return HRESULTs not interface pointers.
getNamedItem method takes two parameters.
From MSXML 4.0 documentation
C/C++ Syntax
HRESULT getNamedItem(
BSTR name,
IXMLDOMNode **namedItem);
Parameters
name [in]
The name of the attribute.
namedItem [out, retval]
An IXMLDOMNode object for the specified attribute. Returns Null
if the attribute node is not in this collection.
|
|
|
|
|
Hi! I am working on an application that requires the display of data graphically - ideally the same as in the AXE hex editor where one colour block represents one byte and a file can be shown as a panel. As a newbie, trying to navigate through the MFC documentation is a nightmare. Anyone able to assist please? If you're anywhere near Ireland, a solution is worth a number of pints of the black stuff!!
Brian Scott
|
|
|
|
|
Brian,
This should fit the bill nicely: http://codeproject.com/tips/frhed.asp.
PS: You can email me the brew.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
I have a COM server (A.exe) it supports two interfaces I1 and I2. I also have two services S1.exe and S2.exe. S1 creates and instance of I1 and S2 creates an instance of I2.
I expected to find only one A.exe running. Instead I find two. This is a problem for two reasons. S2 must release and recreate the interface regularly, causing the initialization of A.exe to happen way too often. The other issue is that I2 and I1 share a global array (protected by a MUTEX). This sharing clearly won't work if there are two separate eA.exes.
Is it possible to do this so only one A.exe is launched? If so, how?
We are supposed to release this today. The cyclic creation and destruction of a second A.exe was just observed for the first time today.
Thanks for the help,
Bill
|
|
|
|
|
Try this, it MAY solve your problem
Add this BEFORE the COM_MAP of your Interface
DECLARE_CLASSFACTORY_SINGLETON(CYourI1InterfaceClass)
- Greatest invention : "The Microchip!"
|
|
|
|
|
I tried it, but it didn't help. I think its because there are two apps accessing two different interfaces, rather than two apps accessing the same interface.
Next attempt is to use CoGetClassObject. MSDN says:
"Provides a pointer to an interface on a class object associated with a specified CLSID. CoGetClassObject locates, and if necessary, dynamically loads the executable code required to do this."
Sounds like it won't load the EXE if it's already there. This coincides with VB and GetObject versus CreateObject.
Unfortunately I get an error AND the wrong effect:
hr = CoGetClassObject(ID, CLSCTX_LOCAL_SERVER, NULL,
IID_IDispatch, (void **)&(m_pBroker));
if(hr = S_OK)
{
g_pErrorLog->LogError(4,"Get Class succeeded " + strObjName,_strModule);
} else {
hr = CoCreateInstance(ID, NULL, CLSCTX_LOCAL_SERVER,
IID_IDispatch, (void **)&(m_pBroker));
g_pErrorLog->LogError(4,"Try to CoCreate",_strModule);
}
When it executes the CoGetClassObject call, I get an ERROR_NO_INTERFACE message 0x80004002. AND a second .EXE is loaded.
Thanks for the help,
Bill
|
|
|
|
|
If you use ATL, Check CComModule::RegisterClassObject call. In your WinMain function , _Module.RegisterClassObject. Check the second parameter - is REGCLS_SINGLEUSE ? If is so , the class factory will be accesible only for one client at a time.
|
|
|
|
|
Have you considered using the GIT or ROT? Singleton won't work because S1 and S2 are seperate processes any data in A won't be shared.
Bill Wilson wrote:
We are supposed to release this today. The cyclic creation and destruction of a second A.exe was just observed for the first time today.
Ah, testing.
|
|
|
|