|
I have a problem in a multi-dll project. Everything works except for an access violation in the CCmdTarget Destructor. Its a CEdit Control I'm actually not using. Now heres where the fun starts, remove the CEdit, and the Spin control in the same dialog now asserts setting the range, claiming it is not a window. Want some more fun? Remove the Spin Control from the dialog class, and now operator new breaks during heap alloc doing a heap check, which then fails no matter how many times you continue (big surprise (end sarcasm)). I had thought maybe it was my use of the MS STL not being DLL safe, so I grabbed stlport, and have the exact same results. I'm not doing anything odd in this code, which is why I did not post it. Instead, I suspect I have done something really dumb somewhere else and have just overlooked it, and am hoping someone here may have done the same dumb thing, or know someone who has, and knows what I have done wrong.
Other steps I have taken: Resource ID confilcts resolved. Making the property pages not be global variables, but instead be on the heap.
The behavior has not changed from the original problem.
Additional Info: m_xDispatch.m_vtbl=2696277389 m_dwRef=1051772663 in the CCmdTarget Destructor, it bails on the line ((COleDispatchImpl*)&m_xDispatch)->Disconnect();
Thanks in advance
Corry
|
|
|
|
|
Hi,
I really need your help. Here is my problem:
I have my application which has the main window. Inside my application, I start another external application and now I like to dock/import the window of the external application into my application main window. PLease show me how to do that.
Thanks
Jimmy
|
|
|
|
|
I've written two seperate dialog based applications. Now I want one of them to send a message to the other, telling it it's status. I've tried postmessage, but it does no seem to pass my CString pointer. In my message event there is nothing in the lparam. I've set it up like naughter suggests but I'm wondering if I'm doing something wrong.
Some questions: In order to sendmessages between two different apps, do I need to register my message?
Can you not send a pointer between two different apps? I've done this using threads between my main app and the threads.
Thanks
Tom
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
|
you think? Hum..I give it a try. Thanks
Tom
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
Tom Wright wrote:
Can you not send a pointer between two different apps?
Short answer: no. Each process has its own process space, memory from one is not visible in others, and addresses in one are meaningless in others. You need to use an IPC mechanism, WM_COPYDATA will probably be easiest since you're already using message to communicate.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
I'm trying to pass a struct with the WM_COPYDATA. How would I receive this on the receving side of my app. Currently this is how I'm doing it right now:
ConnStatus *cConnStatus;
//CString strRecievedText = (LPCSTR) (pCopyDataStruct->lpData);
memcpy(cConnStatus, pCopyDataStruct->lpData, pCopyDataStruct->cbData);
AfxMessageBox(cConnStatus->cID);
I get an assert error, and I think it's because I'm trying to pass lpdata to a pointer to my struct.
Do you have any suggestions on how to do this?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
To send just a string, do this in the sending side:
COPYDATASTRUCT cds = {0};
CString sTheData = _T("foobar");
cds.lpData = (LPCTSTR) sTheData;
cds.cbData = (sTheData.Length()+1)*sizeof(TCHAR); In the receiving side:
BOOL CAppWindow::OnCopyData ( HWND hwndSrc, COPYDATASTRUCT* pcds )
{
CString s = (LPCTSTR) pcds->lpData;
} If you have a whole struct, you need to get all the data into one contiguous buffer so the system can copy it into shared memory for the target process to use.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
i'm using VC++6;
i want to declare a global variable(i.e., to be seen in all the classes of the app)
i tried to declare it n CMyApp ( : public CWinApp) but an error message (undeclared identifier) usually appears..
regards.
keep the matter as simple as it can be !!
|
|
|
|
|
what errror ? and where does the error appears ?
you need to #include your app class .h file in the files you will access CMyApp
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
hi
ypu can declare the "extern int <variable name>" in your stdafx.h the applications global file where you have to use that variable again declare there in that header file your change will affect to the original global variable.
I think this works
Best Regards
ganesh
|
|
|
|
|
I have this code:
//BEGIN ====================
IP_ADAPTER_INFO AdapterInfo[16];// Allocate information for up to 16 NICs
DWORD dwBufLen = sizeof(AdapterInfo);// Save the memory size of buffer
DWORD dwStatus = GetAdaptersInfo(// Call GetAdapterInfo
AdapterInfo,// [out] buffer to receive data
&dwBufLen); // [in] size of receive data buffer
PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo;// Contains pointer to current adapter info
//END========================
I want to convert the pAdapterInfo->Address to a std::string
Can anybody help me on this?
Thanks in advance.
Julio
|
|
|
|
|
Well,
It worked pretty well:
std::string MACData2String (unsigned char MACData[]){
std::string tmp;
char slask[100];
sprintf(slask,"%02X-%02X-%02X-%02X-%02X-%02X", MACData[0], MACData[1], MACData[2], MACData[3], MACData[4], MACData[5]);
tmp=slask;
return tmp;
}
|
|
|
|
|
Hello!
How can I open .col files with hh.exe? I already installed the latest version of HtmlHelp Workshop and tried to run the hhupd.exe, but it tells me that I got a newer version already (I'm using Windows XP SP2).
Do I have to install any update? How to make hh.exe open .col files?
Thanks in advance and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
alcowboy wrote:
I am very new to using VB.NET.
Is that why you posted to the VC++ forum? Try here for a better response.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi, i got a little problem.
In CEdit if we set Number=true we can only enter numerical characters and if we press a non-numeric char, there is an "information message"
My question,
1) is it possible to use something to accept "." s for floating numbers
2) if 1st one is not possible, is there any way to show that information message while not using Number=true format.
Thanks
|
|
|
|
|
If you need floating-point numbers, you'll need to use a custom (masked) edit control. There are several here at CP.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
OK. How can i show windows information message about numeric characters
|
|
|
|
|
I don't understand your question.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
OK. in CEdit when we choose number=true, and we enter a non-numeric character there is an error message like a tooltip. that writes something like not to enter non-numeric characters. Can i call that tooltip(or whatever it is), while not using number=true format.
|
|
|
|
|
ugur_basak wrote:
Can i call that tooltip(or whatever it is), while not using number=true format.
Yes, check out CWnd::EnableToolTips() as well as the CToolTipCtrl class.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
HI all,
is it possible to pre-pend to a CString as opposed to append, ie place a new string at the start of the string instead of the end. Thanks
Shane
|
|
|
|
|
Yes, just switch the order of the operands. Something like:
CString name("is David");
name = "My name " + name; Make sense?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
You can also use the Insert.
Insert( int, PCXSTR );
Insert( int, XCHAR );
Example:
CString test( "is a test" );
test.Insert( 0, "This " );
Larry J. Siddens
|
|
|
|