|
What does debugging an application have to do with anything? And why do you want to be protected from it? If an application has errors, I would think you'd want to know about them.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
i have encoded exe-data (flash projector) in resources and i don't want others to get stuff (images etc.) from it...
ok.. it will only protect from simple resource-hackers etc. not from debugging (sorry for imprecision )
NodeX
|
|
|
|
|
Can you not write it to some temporary folder using an obscure name (i.e., nothing obvious), and then delete it when done? Other than that, I know of no way to run something from memory. It's a stretch, but you might search for something about "injecting code into another process' address space."
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
As a last resort i will do it with temp folder...
but i can't assume that the person who will have my cd-rom with exe, grant me an access to temp folder...
NodeX
|
|
|
|
|
NodeX wrote:
but i can't assume that the person who will have my cd-rom with exe, grant me an access to temp folder...
Why not use SHGetFolderPath() with CSIDL_LOCAL_APPDATA or CSIDL_PROFILE as the CSIDL?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
lol forget it, if someone wants to debug it, he will be able to!
Don't try it, just do it!
|
|
|
|
|
In Windows, the EXE file is mapped as virtual memory. The os loader and other parts of the os perform this task. The idea of running a program from memory, even if it could be done, would be meaningless.
Not worth spending time over. Remember, using this technique, you could bypass some anti-virus programs, but the good ones out there will catch it anyway...
Bikram Singh
|
|
|
|
|
Greetings All,
I've been burning up all of my time over the past two days trying to debug this. Please help!
I've written a DLL that creates a modeless dialog (in this case allowing the user to watch an aiming video image of a Laser Tracker.) This DLL is used by various client applications including my test app.
I need the user to be able to use the arrow keys to "jog" the Tracker from the dialog. Also, all of the normal dialog keyboard control needs to work (tabbing, typing into CEdit boxes, etc.)
At first, I couldn't even get key messages in the dialog...as soon as a key was pressed (with focus on the dialog), the message came to the client app. I found a way to fix this from MS' website involving having the app call a FilterDLLMsg() func from its PreTranslateMessage(). However, now when a key is pressed in the dialog, the dialog and app freeze.
I spent a long time tracing this freeze and it seemed to be freezing around the MFC code for _AfxFindNextMnem. I was stumped and thought it had to do with a tabstop or group setting for my dialog controls. Then I tried changing the m_pMainWnd = &dlg; line in my client application's InitInstance() to m_pMainWnd = NULL; . (It's a dialog based app.)
That corrected the freeze problem, but now any AfxMessageBoxes() I call from my client app seem to belong to the desktop instead of the main app dialog. There may be other, more serious, ramifications, but I haven't tested any further.
So, I don't want to change the m_pMainWnd = &dlg; if I don't have to, but for now, it's the only way I've found to keep the DLL/app from freezing. Is that safe? I'd prefer a different solution.
Has anyone out there ever seen this type of behavior? Any ideas? My brain is getting all mushy as I haven't made much progress on this
Thanks,
Justin
|
|
|
|
|
If your problem is AfxMessageBox(), dont use it. Use
MessageBox(dlg,"some text",0,0) instead.
The desktop is the parent of the Message Box bcos MFC probably uses the m_pMainWnd, which you set to 0, as the first param to the MessageBox() function.
I dont know why the dialog should freeze, cos i havent tried it yet.
Bikram Singh
|
|
|
|
|
I am using TrackPopupMenu to display a dropdown menu from a toolbar button that has an arrow on the right side. Things are working as I expect. The menu is basically a list of items that my user checks on/off. Someone in the office has seen an application where you can click an item in a menu and the menu stays open so the user can "select" multiple menu items and then click off of the menu to close it...they now want this in my app.
Any ideas on how to keep the menu from closing after someone makes a selection?
thanks in advance
cje
|
|
|
|
|
You could try setting a WH_GETMESSAGE hook using SetWindowsHookEx() and intercept WM_LBUTTONDOWN ?
Bikram Singh
|
|
|
|
|
Hi
I need to figure out a way to communicate with an A/D converter and send and receive data bytes from the PC.
Any suggestions and comments are appreciated.
Thanks.
JB
|
|
|
|
|
What is the interface in use? USB/ParPort/Serial...what?
If serial/parport, take a good look at the CreatFile() function in MSDN.
Bikram Singh
|
|
|
|
|
Dear Bikram
thanks for your reply. I will refer to the CreateFile() function.
I am using a parallel port interface and linking the A/D converter to the PC through a SCSI cable.
thanks
JB
|
|
|
|
|
I have bunch of files in *.cpp format ( written in VC++). Presently i read the data from a text file and run the program. I want to make a GUI ( using MFC or anything else) so that user can enter the data in the GUI and hence the program reads it from there..
Please give any suggestions and ways to do it..
|
|
|
|
|
ummm probably wanna go with MFC...create a dialog based app add text boxes or whatever and goto town...
Cheers
How do I print my voice mail?
|
|
|
|
|
Hi,
I'm a newbie working on an MFC app which needs to display a simple text file of results. I have searched google as well as codeproject, but am stumped as to how i can do this.
I am guessing i'll want to derive a class from CRichEditView, and add the text from there, but how do I add text?!
If anyone has any tips, or places i could look for an answer, it would be greatly appreciated.
Thanks,
Mike
"I bet Einstein turned himself all sorts of colors before he invented the light bulb." -- Homer J.
|
|
|
|
|
How do you want to display your results...? What kind of results are they?
It would probabbly be much easier to dump your result to a listbox than using a rich edit.
How do I print my voice mail?
|
|
|
|
|
It's just a text file created by our backend that lists concentrations of different elements.
I want to display them similar to notepad, where the user can scroll up and down, to review, and print if desired.
listbox, eh? I'll look into that.
thanks.
mike
"I bet Einstein turned himself all sorts of colors before he invented the light bulb." -- Homer J.
|
|
|
|
|
mike-o wrote:
I am guessing i'll want to derive a class from CRichEditView, and add the text from there, but how do I add text?!
Assuming the text is in a variable (e.g., CString ), you can simply call the rich edit control's SetWindowText() method.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Ah, that sounds like a good plan.
thanks!
mike
"I bet Einstein turned himself all sorts of colors before he invented the light bulb." -- Homer J.
|
|
|
|
|
And you have not found my article http://www.codeproject.com/file/textfile.asp[^]? Shocking!
The class contains a member Load that directly loads the contents of a file to an edit control (or a listbox). And here ones takes time to carefully craft and upload code...
|
|
|
|
|
Hello dear programmers,
You can see me as a beginner, actually I know only what I need to know to make an application in Visual C++. I'm having an OOP problem using MFC now.
I give you a peace of code here so you know what I mean.
But first my question: My purpose is to make pointer to a class. For example, in my clientsocket Clisocket I want in my constructorparameter a pointer to the class CSockCliDoc. In a sample code wich it works fine, it is like this:
#include <wcesock.h>
class CSockCliDoc;
class CCliSocket : public CCeSocket
{
// Attributes
public:
// Operations
public:
CCliSocket(CSockCliDoc *pInDoc);
virtual ~CCliSocket();
// Implementation
protected:
private:
CSockCliDoc *pDoc;
};
What I don't understand is the second line:
class CSockCliDoc;
What is the purpose of this part of code . I know that if you want to create a new class, you begin with "class whatever" and than "{the rest of the code for wathever it is};"
Can anybody help me to understand why the second line is needed?
Thank you very much, I'm sorry for my bad English, I'm from Holland.
|
|
|
|
|
Anonymous wrote:
class CSockCliDoc;
class CCliSocket : public CCeSocket
{
CSockCliDoc is an ahead declaration. It means "I'm going to use a pointer to CSockCliDoc in the class declaration below, but I've not declared the class itself here. It is defined elsewhere."
Anonymous wrote:
Thank you very much, I'm sorry for my bad English, I'm from Holland.
That's not an excuse, you're supposed to speak good English there
|
|
|
|
|
Thanks Johan ,
But that "ahead declaration" is that a standard C++ technique, or do they use it only in MFC?
Can you give me some links where I can get more information about ahead declaration?
I'll do my best to speak english well
|
|
|
|