|
|
good afternoon, all
I tried to debug this app who has memory leak. when I place the "@ERR,hr" on the watch window - which works same as "int test = GetLastError();", I got this meassage "0x000000b7 Cannot create a file when that file already exists", when the app is over this line:
BillMaster = new billmstr;
if I clicked F5 or F10 it will let me keep going on debug, but what exactly is this messages mean? billmaster is already exists? thanks.
|
|
|
|
|
The message means you're trying to create a file on disk, when that file already exists. You can set your streams to overwrite files, perhaps that's what you need to do ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I'm developing an ActiveX control to be displayed in a webpage, and the webpage will solely be used within an intranet of my client's company. However, I'm having slight problems getting my control (which is written in MFC) to initialize itself. When the control is being used on a webpage hosted non-locally, the function DoPropExchange never gets called, the control window is never created etc. However, when I register the control manually, and view the same webpage - this time stored on my local machine - these problems do not apply. The only difference is that before these functions are called, a message appears saying "An ActiveX control on this page might be unsafe to interact with other parts of the page. Do you want to allow this interaction?". If I say yes to this question, everything works fine. I would REALLY like to know if there are some settings within Internet Explorer that somewhere specify "prompt the user about unsafe activex controls: Disable-Enable-Prompt", and I would assume that for my local machine this setting is set to "Prompt", but on the internet it is set to "Disabled". So, would anyone know which setting this is and where to find it?
Best regards,
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Nevermind, I just added the page to the Trusted sites section, and then it works as expected...
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
how to check if a PC is connecing to the internet programmaticaly by VC application?
includeh10
|
|
|
|
|
How about this?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
none of them works.
my VC6 doesn't have the "best function" IsNetworkAlive().
includeh10
|
|
|
|
|
|
Hi everyone,
I have a need where I have to move a button programatically.
I am trying to use the SendMessage(handleOfButton, WM_MOVE, 50, 50) function, but it does not seem to work. I have a feeling it only works on top level windows or dialogs. Is there a way to move a button programatically. What message should I use?
Cheers,
-K
-- modified at 15:19 Wednesday 26th October, 2005
|
|
|
|
|
Keith Vitali wrote: I am trying to use the SendMessage(handleOfButton, WM_MOVE, 50, 50) function, but it does not seem to work.
Probably because it's a message that the framework sends after a window has been moved. Try MoveWindow() or SetWindowPos() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi,
Is it possible in anyway to load a file into memory and then run it
from there? I am working on a file compressor
(www.nemokprod.go.ro/nb.htm) that can compress and encrypt and save
multiple files as an exe file that can then run the compressed files
after unpacking them to a temp folder. The problem is that I have to
unpack the files to the hard-disk and then run them from there, making
them vulnerable to user that may try to get the original (unprotected)
files.
So the user shouldn't have access to the file operations in the
background. So I need to keep the original unpacked files hidden from
the user, until after they are opened by the unpacker and then deleted.
So users should have no kind of access to the files (should not see
them, open them, should not be able to modify or copy them) but the
unpacker should be able to run them. (that is why I think that the
memory is the best solution)
So is there any way to protect them, like unpacking them directly to
memory and then run them from there? Something like a virtual disk in
memory?
Thanks.
Nemok
|
|
|
|
|
This has been asked many times before but an answer is still 'unknown.' If you unpacked the files to disk, could you not use an obscure name like a GUID rather than something like mysecretfile.exe?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Yes but using a FileMonitor like the one from SysInternals it is very easy to find out what files is the app working with.
Nemok
|
|
|
|
|
True, but if the name were not obvious, would the person know what to do with it even if they managed to make a copy of it?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Yes but I need some more fail proof than that.
Nemok
|
|
|
|
|
a little Googling is enough to convince me that it is not a simple task.
you might take a look at UPX (available from sourceforge). i think it can do this.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hi,
It is possible to load a binary, executable block of raw data into memory and link a function to it. So you could call that 'extra' function from your code without any problem. Maybe this is what you need ??
But to load an entire file into memory and to run it that is something different.
codito ergo sum
|
|
|
|
|
Actually yes I need to load an entire file and run it. Any ideas?
Nemok
|
|
|
|
|
Are you looking to just load dlls, or run the actual exe from memory? I've been working on virtual files system similar to thinstall, but am far from finishing. However, I do have some code that will load a dll from memory with certain limitations. Just depends on what you exact needs are.
--
Joel Lucsy
|
|
|
|
|
Hello,
I've encountered a strange problem when I use the const_cast() operator. See the following code that behaves strange:
std::stringstream sstrMsg;
char* pszMsg = const_cast<char*>(sstrMsg.str().c_str());
SPrintBuffer(&pszMsg);
I've checked the return values of both stringstream::str() and std::string::c_str() . They both return the expected data. Strangely enough, after the cast, pszMsg points to some undefined memory address. (The address pointed to holds the value -18).
I'm currently using the following workaround:
char* pszMsg = new char[sstrMsg.str().length()];
strncpy(pszMsg, sstrMsg.str().c_str(), sstrMsg.str().length());
SPrintBuffer(&pszMsg);
delete[] pszMsg;
Does anybody have a clue why const_cast is producing undesired results?
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi,
If you mean the const_cast casting operator, I believe you have used it wrong. It should be used like this:
char* pszMsg = const_cast<char*>(sstrMsg.str().c_str());
This shouldn't give any problems.
codito ergo sum
|
|
|
|
|
Hello,
I used it just like you said it should be used. It's just that the '<' and the '>' 'disappeared' because I didn't use '<' and '>' respectively. Sometimes the parser for the message removes those in pre tags and sometimes it doesn't.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Your code looks very dangerous.
Q1) Why would you need to cast away the constancy of the pointer returned by c_str() ?
How about using: const char* pszMsg = sstrMsg.str().c_str();
Q2) Why would a function named SPrintBuffer() need a pointer to a pointer of type char* ?
The name implies that it is just going to print out the contents of the buffer, not modify it.
Note: Modifing the data return via c_str() , is a very bad idea.
INTP
Every thing is relative...
|
|
|
|
|
I know that the code looks very dangerous. I double checked the code for SPrintBuffer() and it doesn't modify the string.
The reason that the reason the function takes just a char* and not a const char* is unknown to me. I need to add a link layer of a protocol to a program that my teacher wrote. Please don't tell me, the entire program is badly designed and all the code looks like spaghetti... If you want to see some obfuscated C code, this program is right for you!
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|