|
I'm using a library in my MFC application and i'm having some memory problems with allocations and deallocations, some memory allocations/deallocations causes a crash but only if it is not running on debug-mode. In debug-mode the application runs perfectly. Here's my lib configurations:
engine.lib ( Non-MFC Code ):
. Configuration Properties:
----. General:
------. Configuration Type: Static Library ( .lib )
------. Use of MFC: Use Standard Windows Libraries
----. C++:
------. Code Generation:
---------. Runtime Library: Multi-Threaded Debug ( /MTd )
editor ( MFC Code ):
. Configuration Properties:
----. General:
------. Configuration Type: Application ( .exe )
------. Use of MFC: Use MFC in a Static Library
----. C++:
------. Code Generation:
---------. Runtime Library: Multi-Threaded Debug ( /MTd )
------. Precompiled Header:
---------. Create/Use Precompiled Header: Automatically Generate( /YX )
----. Linker:
------. Command Line: /NODEFAULTLIB:LIBCD.LIB
Noticed anything wrong ? Any tip ?
Thanks
|
|
|
|
|
It is nothing to do with your configuration. It very likely cause by your code.
The reason it won't crash in debug mode is that your linker allocates more storage space for each memory blocks in your program for debug purposes. So, even if your program leaks, the extra space storage save you from crash. This is not going to happen when you are in release mode as when your linker allocate exact storage space for your program.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
Hi
does ne1 know the best way to do a http post ?
thanks
simon
|
|
|
|
|
Use CHTMLView (MFC) or use IE COM object.
Or look for low level http protocol helper class in codeproject.(if any)
Hope this helps
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
|
Check out HTTP 1.1 protocol.
http://www.w3.org/Protocols/rfc2616/rfc2616.html
Kuphryn
|
|
|
|
|
I need to create a CBitmap using data buffer. To insert into a image list
|
|
|
|
|
I all, i am becoming mad for this problem!
i am using ShellExecuteEx to launch an external program.
When i pass parameters these must be separed with spaces, then
if i pass the parameters "pippo.txt pluto.ppp", my program work fine,
but if pass "c:\Documents and Settings\.....pippo.txt pluto.ppp", then
the word "and" is used by ShellExecuteEx as parameter,
then how can i quote the spaces???
The voice is inside us
|
|
|
|
|
use \" to put a quote in string
CString str = "\"test.exe\" test.doc"
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
i have done it but don't work!!!
Leto
|
|
|
|
|
Placing space in the parameter traditionally is considered as end of the parameter, So i guess you need to apply some logic to avoid space where needed and where not. like passing "Program files" as "program_files" and then remove the _ in the program to whome you are passing the paramter.
My God is more powerfull Than Your God. (the line that divides the world)
|
|
|
|
|
you'll probably need to enclose your full filepath in enclosing quotes. e.g:
<br />
CString strFilepath = "\"c:\\program files\\this file.txt\"";
I Dream of Absolute Zero
|
|
|
|
|
NOW IT WORK,,, thank you very much!!!!!
|
|
|
|
|
Hi Guys,
I am getting a very strange error when every I pass the CStringArray to the function.
the error is "cannot convert parameter 4 from 'class CStringArray' to 'class CStringArray'"
Any idea.
Thanks,
Best Coder
|
|
|
|
|
Pass your array by reference, instead of by value.
Something like:
void SomeFunction(CStringArray& arrParamArray);
I Dream of Absolute Zero
|
|
|
|
|
I successfully Solved the problem.
Thanks a Lot.
"And they do not show off their charm (Zeena) except only that which is apparent and let them draw their head coverings (khumur) over their necks and bosoms (juyub)"
|
|
|
|
|
Is there a way to get a function name in a macro? Something similar to __FILE__.
Basically I use the class name and function name in debug statements through-out my code and I want a way to automate the insertion of these values. Ideally I want the values at compile time.
Thanks
Mike
|
|
|
|
|
Functor or pointer to function?
Not sure if this is the thing you want.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
What I want is the function name as a string. What I currently use is
DB((_T("ClassName::MethodName Some message")));
What I want to be able to do is get the "ClassName::MethodName" bit without having to type it in each time.
|
|
|
|
|
Hi,
I am trying to change the configuration of the service SQLSERVER AGENT using the API ChangeServiceConfig. In that I am passing a new user name and password as arguments. That API returns successfully and I can change the StartType (AUTOMATIC,DEMAND_START etc) as well. But after that when I try to start the service using the API StartService, it returns the error:"The user doesn't have the permission to log on as a service".
Why is this so? How can I change the configuration successfully through the program? Is ChangeServiceConfig is not the API for this?
When I manually set the User name and password using the properties dialog of that particular service a message appears that this particular user "has been given the right to Log on as a Service" (that is when I click the Apply button on that dialog).After that it is possible to start and stop the service through program. But for the first time it fails. So how can I achieve the functionality which the Apply button (of the properties dialog, provided by windows) is doing??
Plz help,
thnx in advance,
AK.
***
|
|
|
|
|
Look at the PSS article 132958, entitled "HOWTO: Manage User Privileges Programmatically in Windows NT".
Essentially, it's a step-by-step guide to using the LSA (Local Storage Authority) subsystem, from LsaOpenPolicy(), LsaAddAccountRights() etc
In fact, it's exactly what you want, I suspect;
"This sample will grant the privilege SeServiceLogonRight to the account specified on argv[1]. "
Steve S
|
|
|
|
|
Yes, you are absolutely right.
I implemented it successfully.
thnx...
AK.
*******
|
|
|
|
|
As you said I implemented it and its working fine with WindowsNT, Windows2000 os. But it fails in WindowsXP. Again the same error: "Logon as Service right not given".
How to rectify it??
thnx...
AK.
********
|
|
|
|
|
Hi,
I was wrote a service, I want write an application to communicate with this service, I use Socket mechanism but when I start service it generate error.
Have you resolve for this problem?
Please help me.
Thank you .
L.H.Dung
|
|
|
|
|
What errors do you get?
Can your service start without the socket start listening?
Your question is ambiguous.
Sonork 100.41263:Anthony_Yio
|
|
|
|