|
Hi,
You must also take into account that throwing exception will call the destructors of all stack-created objects. That's why there are times when it is more efficient to return an error code rather than throw an exception.
Best regards,
Alexandru Savescu
|
|
|
|
|
I want to monitor my computer's share directory in the LAN, when some files are deleted or renamed or modified by other computer. I can recored it.
but I don't know all this being done by which computer! How can i do it ?
Thanks a lot!
How can I know which remote computer access which file of my computer?
How can I finished it with MFC or VC?
|
|
|
|
|
I want to monitor my computer's share directory in the LAN, when some files are deleted or renamed or modified by other computer. I can recored it.
but I don't know all this being done by which computer! How can i do it ?
Thanks a lot!
How can I know which remote computer access which file of my computer?
How can I finished it with MFC or VC?
|
|
|
|
|
All my buttons are passed through OnCtlColor() but I can't change the text colour or background. I could subclass the control (seen the article in CP) but I am lazy so is there a way to do it in OnCtlColor?? If not, then why doesn't it work when edit boxes, static boxes, etc.. do.
cheers!
Adam.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
From MSDN docs on WM_CTLCOLORBTN:
Buttons with the BS_PUSHBUTTON, BS_DEFPUSHBUTTON, or BS_PUSHLIKE styles do not use the returned brush. Buttons with these styles are always drawn with the default system colors. Drawing push buttons requires several different brushes-face, highlight and shadow-but the WM_CTLCOLORBTN message allows only one brush to be returned. To provide a custom appearance for push buttons, use an owner-drawn button.
In other words, "this feature is by design"
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Tomasz,
You are de man. Thanks! How come you know all this stuff? You and Nish seem to be the most prolific contributors.
cheers once again
Adam.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
How can I know which remote computer access which file of my computer?
The remote computer and the local files are not certain?
How can I know it?
How can I finished it with MFC or VC?
|
|
|
|
|
Hi,
I have written a small utility that generates a small setup program. The setup program uses an icon, bitmap and ini file that is selected by the user in the initial utility (the info about the icon and bitmap it should use are contained in the INI file). Essentially this works as follows:
Utility -> User selects a bitmap, icon and output path
-> Presses "Create"
-> The icon, bitmap and a premade executable are copied to
the output path
-> An ini file is generated with info about the bitmap and icon
Whenever the user opens the generated executable, the EXE looks for the INI file to find out which bitmap and INI file it should display.
So far, so good. However, what I really want to do is, instead of having the icon, bitmap and INI file stored as separate files in the same folder as the EXE, I would like to somehow compile them INTO the generated EXE. ie. So that instead of four files being created (EXE, icon, bitmap, INI), only one executable is created. (Perhaps an INI file isn't even needed if it is done this way?) In other words, I need to compile a new executable dynamically, from my program, based upon a premade EXE (I take it that it needs a premade EXE?).
Does anybody know how to do this? I see a lot of tools that do it, but I can't work out how they work.
Many thanks for any help,
Keith
|
|
|
|
|
code project article.
You may also find source code on the net (look for Matt Pietrek's articles on PE (Portable headers)).
And I swallow a small raisin.
|
|
|
|
|
Hi,
Thanks for your reply. I don't exactly want to create a setup program. What I want to do, I have realised, is append the files in a similar way to the DOS copy instruction. Eg. in DOS:
copy /b launcher.exe + bitmap.bmp + icon.ico + config.ini newfile.exe
I basically need a C++ way of doing this. I then need to make it so that the launcher.exe can read from the config.ini file that has been appended to it and find the bitmap and icon that have also been appended to it etc.
I'd be really grateful for any ideas on how to do this.
Many thanks,
Keith
|
|
|
|
|
What are you talking about ? the copy /b does a concatenation of binary files. Doing copy /b results in a binary file, not an execute file.
For an .exe to execute, you need appropriate PE headers.
So you need exactly that "setup" thing. Take the source code and tweak it for your own use.
And I swallow a small raisin.
|
|
|
|
|
I made an application in C++, there are several functions in this program that have very large number of local variables and large size local buffers. Please tell me that when this program consumes more memory, i.e whenever it runs or whenever it call certain function on stack that has such big variables ??
|
|
|
|
|
If local variables aren't static, the space is allocated on the stack when function is executed. When function finishes, this space is freed.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
I think that when your program calls such function and there is not enough committed memory for stack, it commits required space. That means, the memory consumed by the program may be increased when such function is called.
When function finished, committed memory is not released.
|
|
|
|
|
Under Windows (at least NT/2000/XP; I don't know about 9x/ME), the program's working set (the memory committed to the application) wouldn't grow until the function that had the large local variables was called. At that point, if there was insufficient memory allocated to the stack, Windows would allocate more until it was of sufficient size. After the function returned, the extra space would be left in the stack. I don't know if or when Windows would release that memory for other use.
Gary R. Wheeler
|
|
|
|
|
I'm sending a mail using shell execute and I was wondering if there were methods of filling in the other fields such as subject etc. from ShellExecute?
Cheers
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
Are you using a mail server, email client, browser or what? Be more specific. If you're using Outlook and/or exchange you can use the CDO library to do anything you want. If you're using a browser then specify the params in the mailto tag (e.g.; mailto:jdoe@somewhere.com?subject=hey&body=hi&bcc=no@where.com).
Jeremy Falcon
Imputek
<nobr>"C# is the answer to a question nobody asked." - Chris Losinger
|
|
|
|
|
Jeremy Falcon wrote:
If you're using a browser then specify the params in the mailto tag (e.g.; mailto:jdoe@somewhere.com?subject=hey&body=hi&bcc=no@where.com).
This also works with Outlook.
|
|
|
|
|
I've made a tcp/ip server application. The server is a console based program written in pure C++, though it uses Win32 API . I want to add a feature of sending email from it, i.e whenever a client sends a particular message to server, the server send email to some email address on internet. How can i achieve this goal easily ???
|
|
|
|
|
You could reuse ideas from codeproject article.
MFC CAsyncSocket is a thin wrapper on top on winsocks.
And I swallow a small raisin.
|
|
|
|
|
I can't use article u suggested because it requires MFC
|
|
|
|
|
Yes, and what's the problem ? Just remove the MFC stuff.
And if you don't take this code and remove MFC, this article simply teaches you how to send an email without using Mapi32.dll (which is what you end up with otherwise). If you don't like it, well ok, even though you'll hardly find anything better.
And I swallow a small raisin.
|
|
|
|
|
Hello,
I would like to know the best way to upgrade/uninstall a shell extension. Simply unregistering is not enough as Explorer keeps the file locked for a certain amount of time. I also saw one piece of code that restarts the Shell but this is not very elegant because all the Startup Items are relaunched and this causes a mess not counting the disappearing and reappearing of the task bar...
The method I have been using for the last year or so works but I would like to have something more simple. For instance an upgrade is done like this: my installer copies the .dll to a .tmp file then unregisters the .dll and tries to delete the .dll file. It the deletion is successful then the .tmp is renamed to .dll and is registered: everything is fine. If the deletion fails then my installer creates a .bat file that deletes the .dll, renames the .tmp, registers the dll and deletes itself (this is why it is a .bat file: a .bat can delete itself while running, a .exe can't). Then this .bat file is registered in the RunOnce section to be executed at the next reboot. Uninstallation follows the same kind of process.
As you see this is kind of complex... I have been looking on the web for other way to do this but did not find any info. So anyone has something on this topic??
|
|
|
|
|
Hi,
I have done some work related to read and write CD Sectors by using ASPI
SCSI Command in the framework of VC++ 6.0 and windows 2000.
Now my question is:
What are the differences for reading and writting sectors for DVD by using
same method (Aspi scsi command)? Did you have any experiences and Any ideas?
Thanks in advance!
chen
|
|
|
|
|
chen wrote:
Did you have any experiences and Any ideas?
<theory>
The DVD media should be of no or little consequence with its layering and density as compared to CD as long as you have the hardware, as its methods are independent.
</theory>
Jeremy Falcon
Imputek
<nobr>"C# is the answer to a question nobody asked." - Chris Losinger
|
|
|
|