|
|
hey all,
thanks to all for responding to my questions so far and helping me learn MFC/VC++
I have one more on my way...
Iam using VC++6.0 and have implemented the serial communcation between PC and the serial device(RABBIT3000-an 8 bit microcontroller).
When I build the program, everythign goes fine. I can send and receive packets on both ends.
But when I try to send a packet to the Rabbit from PC more than once, my VC++ code breaks..saying "assert failed"
the failure is in line 304 of MFC/SRC/WINCORE.CPP
ASSERT(pWnd == NULL || pWnd->m_hWnd == hWnd);
what does this mean?
CAn anyone explain?
Thanks in advance.
|
|
|
|
|
It has probably nothing to do with the communication itself (more with the way you are handling the data, if you show that on a window or something). It is really difficult for us to give a solution. You have to track the problem yourself. The best way to do that is to use your debugger: press F5 and see where it crashes, you can the use the call stack to see which function in your code was called last. Then, you can set breakpoints and do step-by-step debugging in the code where there are problems.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
hey there,
thanks for ur response.
Will try debugging.
|
|
|
|
|
When the assertion fires, click the Retry button. This *should* take you to line 304 of wincore.cpp. From there you can view the call stack.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello
when i try to access the function in the secont function.....
it gives me error
these both functon belong to same class.
"Illegal call of Non Static Member Function".
how to rectify this error?
thanx
|
|
|
|
|
type some code to get more detail
|
|
|
|
|
hello..
sipxmngr::EventCallbackProc(SIPX_EVENT_CATEGORY category,void* pInfo,void* pUserData)
{
SIPX_CALLSTATE_INFO* pCallInfo = (SIPX_CALLSTATE_INFO*) pInfo ;
switch (category)
{
case EVENT_CATEGORY_CALLSTATE:
{
switch (pCallInfo->event)
{
case CALLSTATE_OFFERING:
error here sipxmngr::handleCallStateEvent(pCallInfo);
break ;
}
}
return true ;
}
int sipxmngr::handleCallStateEvent(SIPX_CALLSTATE_INFO* pCallInfo)
{
switch (pCallInfo->event)
{
case CALLSTATE_NEWCALL:
sipxmngr::handleNewCall(pCallInfo->hCall, pCallInfo->cause);
break ;
}
return 1;
}
plz tell me the solution.
|
|
|
|
|
U cant call a non-static function like this
<br />
sipxmngr::handleCallStateEvent(pCallInfo);<br />
U need to have an object of the class sipxmngr or make the second function static
|
|
|
|
|
aavesh wrote: when i try to access the function in the secont function.....
The function. Which function ? The second function. Which one ?
Dude, post some code to explain your situation more in detail.
The only solution I can give you here is to make the second function static.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
hello..
sipxmngr::EventCallbackProc(SIPX_EVENT_CATEGORY category,void* pInfo,void* pUserData)
{
SIPX_CALLSTATE_INFO* pCallInfo = (SIPX_CALLSTATE_INFO*) pInfo ;
switch (category)
{
case EVENT_CATEGORY_CALLSTATE:
{
switch (pCallInfo->event)
{
case CALLSTATE_OFFERING:
error here sipxmngr::handleCallStateEvent(pCallInfo);
break ;
}
}
return true ;
}
int sipxmngr::handleCallStateEvent(SIPX_CALLSTATE_INFO* pCallInfo)
{
switch (pCallInfo->event)
{
case CALLSTATE_NEWCALL:
sipxmngr::handleNewCall(pCallInfo->hCall, pCallInfo->cause);
break ;
}
return 1;
}
plz tell me the solution.
|
|
|
|
|
aavesh wrote: plz tell me the solution.
I already told you. Did you try it ? What is the problem ?
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
In the OnInitDialog function,
Add a member
HICON m_hIcon;
in the ctor or OnInitDialog, load the icon
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
call SetIcon to set the Icon
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
It's over, now comile compile and run, you can see the icon
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
-- modified at 4:23 Friday 30th June, 2006
|
|
|
|
|
thx a lot
|
|
|
|
|
I try to spy some game using directx8 graphic but I do not get any document about direct8 (only Direct9 Sad). May some one send me somethings.
My mail: sea.loves.you@gmail.com
Very thank.
|
|
|
|
|
Hi I've a requirement to hook into the PrintDlg/StartDoc/EndDoc API's using a global hook to obtain information when the end user does a print from any application that has a File/Print interface.
Any ideas as to what might be the best way to do this ? I'm considering using APIHijack - A Library for easy DLL function hooking by Wade Brainerd (http://www.codeproject.com/dll/apihijack.asp[^])
Any ideas/suggestion would be welcome.
|
|
|
|
|
Hello
Can I able to use the windows explorer context menu in my application.
If possible give me a hint so that I can try.
Regards
Anil
|
|
|
|
|
|
Thanks I will try my best.
ANd hope for some help if I will stuck some where in future.
Regards
Anil
|
|
|
|
|
|
void CParseView::GetEmbeds()
{
IHTMLElement* pDocElem;
IHTMLElementCollection* pElemCollections;
IHTMLDocument2 * pHTMLDoc2 = NULL;
pHTMLDoc2 = (IHTMLDocument2*)(this->GetHtmlDocument());
pHTMLDoc2->get_all(&pElemCollections);
COleVariant varName;
varName = SysAllocString(L"OBJECT");
IDispatch* spDispEmbed;
VARIANT name;
name.vt = VT_I4;
pElemCollections->tags(varName, &spDispEmbed);
IHTMLElementCollection* spCollectEmbed;
spDispEmbed->QueryInterface(IID_IHTMLElementCollection, (void**)&spCollectEmbed);
if (spCollectEmbed)
{
long lLen;
spCollectEmbed->get_length(&lLen);
for (long i = 0; i < lLen; i++)
{
IDispatch* pItem;
name.lVal = i;
spCollectEmbed->item(NULL, name, &pItem);
IHTMLElement* spElement;
pItem->QueryInterface(IID_IHTMLElement, (void**)&spElement);
if(pItem)
pItem->Release();
if(spElement)
spElement->Release();
}
}
if(pHTMLDoc2)
pHTMLDoc2->Release();
}
use the code, I got the length:lLen=4;but I can only fetch the first two Items,when i=2,pItem got a NULL. How could this happen?
|
|
|
|
|
Maybe instead of
spCollectEmbed->item(NULL, name, &pItem);
you should use
spCollectEmbed->item(name, NULL, &pItem);
or
VARIANT v2; v2.vt = VT_I4; v2.lVal = 0;
spCollectEmbed->item(name, v2, &pItem);
I hope it helps.
|
|
|
|
|
Thank you.
But all the same.
VARIANT varIndex;
varIndex.vt = VT_I4;
varIndex.lVal = 2;
VARIANT var2;
VariantInit( &var2 );
spCollectEmbed->item(varIndex, var2, &pItem);
I tried above. I give the varIndex a const:2;
pItem is not NULL now which would be null if I use a for loop when i==2;
so strange.
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|