|
Yourwelcome.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Hi,
I have a Window app from which I am doing communication to a DOS app via named pipes
My method of doing this is to signal a event after I have queued the messages to the DOS app
The method from which I am signaling the event is inoked via SendWindow and has
and thus has a prototype LRESULT (WPARAM, LPARAM)
The problem is as soon as I SIGNAL the event control is transfered
When control is returned to the method which signaled the event it executes the
next statement which causes an access violation
listed below is the code in question
<pre lang='cpp'> LRESULT CprogDebug::receive_tcpip(WPARAM mywparam,LPARAM mylparam)
.
.
.
.
.
myeventptr->send_window = this;
myeventptr->SetEvent(); // queue message
return TRUE; // <==== access violation </pre>
Thanks in Advance
|
|
|
|
|
Any time I see this on return, I think stack corruption.
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Does that mean I should increase the stack size
|
|
|
|
|
Not necessarily, although that could be a reason.
Does it declare the access violation when you reach the return statement or when you step through the return?
Charlie Gilley
<italic>You're going to tell me what I want to know, or I'm going to beat you to death in your own house.
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
Try to strip down your function to an absolute minimum and see if it still happens.
|
|
|
|
|
in my experience it often indicates a calling convention mismatch, e.g. a stdcall/cdecl mixup.
|
|
|
|
|
Only if you need to, otherwise you'd just be masking the problem.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Okay
I think Luc Patyn is right I use LPARAM myparam as char * the string points to string returned by TCP/IP from the server machine
Thanks
|
|
|
|
|
thank you for all those who pointed me to the stack that is indeed were the problem
was I had declared a CString as local/stack variable and and it was a long string
I moved it outside of the function global and okay
two question come to mind
1) how would I increase the stack if I needed it
2) using the new operator on the CString would seem to also alivate the problem
as that would allocate the string on the heap
thanks again
|
|
|
|
|
I have this program that I wrote in vb, and I want to rewrite it in c++. I would like to retain the click once deployment feature, but I don't know which ones support click once.
|
|
|
|
|
None that I know, but rewriting it in C++ will beat it in complexity by a mile.
If you are interested in one-click deployment solutions, opt for a rewrite in C# instead
P.S. There is, of course, such thing as Install-Shield, something I would not recommend anyone, after using it for couple years, and then moved to NSIS, no looking back.
|
|
|
|
|
Vitaly Tomilov wrote: but rewriting it in C++ will beat it in complexity by a mile.
I must concur with that.
I did some digging around, and there is talk that I can do a manual mage.exe to alter the project for click once.
Thanks
|
|
|
|
|
Does NSIS support 64bit systems? It doesn't seem like it in the project webpage...
|
|
|
|
|
That looks interesting. I never did like the click once deployment, but you can launch it from a web page.
Thanks Albert
|
|
|
|
|
Yes it does, I have been deploying 64-bit software with NSIS for the last 4 years. It is perfect for any kind of installation, worthwhile learning also.
I would suggest a special unicode branch of NSIS: http://www.scratchpaper.com/[^]
|
|
|
|
|
I'm using an outdated version of InstallShield which I absolutely hate... so I may have to try something else soon.
|
|
|
|
|
Hi everybody,
As you could read in my other question. I want to get rid of the CRL both external (/MT) or internal (/MD).
I am almost done and I eventually also want to remove the input of the msvcrt.lib. As soon as I do that I get an error on having _ftol2 etc not defined.
So I looked up my program in IDA and I noticed that they automatically generate _ftol2 and use it to convert from float to long.
Anybody knows how to get rid of these automatically generated functions.
Regards,
SystemFiles
|
|
|
|
|
|
yeah that will probably work. I will give it a shot.
EDIT: That worked flawless thanks!
modified 20-May-12 5:20am.
|
|
|
|
|
Hi everybody,
I want to get rid of all the imports from the CLR. So I decided to make some functions on my own for example cos() sin() tan() asin() acos().
I already have cos and sin and tan done:
FLOAT Sin( FLOAT A )
{
_asm FLD A;
_asm FSIN;
}
FLOAT Cos( FLOAT A )
{
_asm FLD A;
_asm FCOS;
}
FLOAT Tan( FLOAT A )
{
_asm FLD A;
_asm FPTAN;
}
As you can see I am using inline floating point assembly. But then I thought I could probably use FACOS or FASIN, but those instructions don't exist.
Anybody know how I could constructe asin() and acos(), without using the CLR ofcourse.
Regards,
SystemFiles
|
|
|
|
|
when sine or cosine are known, so is the other (remember sin^2 + cos^2 = 1 ), hence also the tangent. Therefore use FPATAN.
|
|
|
|
|
takes a while before I understand what you mean hehe math actually isn't my best point of programming.
I will get to this later!
|
|
|
|
|
Sorry still dont exactly understand what your saying.
|
|
|
|
|
when you know cos, you know sin (except for its sign); and vice versa.
when you know cos and sin, you know tan. So use FPATAN.
|
|
|
|