|
What you're asking is not viable really. Remember that string resources are embedded in the executable, thus adding a string at runtime, permanently adds the string to the executable (even if it were possible to add one while another executable is running, which is usually not possible because the file image is locked).
What you probably want to do is simply send a string to another app and have that app display it. You can do this using the WM_COPYDATA message, which you can then add a WM_COPYDATA handler to your application.
|
|
|
|
|
What Eric suggested is the best way, but if the two threads are within the same process, all you need is a user-defined message and to use either the WPARAM or LPARAM to send a pointer to the string.
Here's how you do it with a user-defined message the last parameter is LPARAM and is not used in this example) - I also assume you're using a CString, hence the double-cast for the WPARAM:
void CMyClass::SendMyMsg(CString sMsg)
{
SendMessage(UWM_MYMESSAGE,(WPARAM)((LPCSTR)sMsg), 0);
}
In your message handler, you'd do this:
LRESULT CMyDialog::OnMyMsg(WPARAM wParam, LPARAM lParam)
{
CString sMyRcvdMsg = (LPCTSTR)wParam;
// do something with the string now
return 1L;
}
Using WM_COPYDATA is MUCH more flexible however. I'm working on an app right now that uses WM_COPYDATA quite extensively because of the added flexibility. When it's done, I will be posting it here.
|
|
|
|
|
That is what I ended up doing. I was more curious than anything about posting into the string table, seems like something that would be neat (technical term) to be able to do though. Thanks for the help!
|
|
|
|
|
Hi,
Is there a visual studion option which would
help me to execute a file, somewhere in my drive, after
a successful compilation.
I need this because, i want to copy my executable/dll from the debug folder a different place for execution, write now i'm doing this with a batch file, any other technique to automate the process which could also, take care whether the executable already in memory, which means the file copy could not be done .....
Thanks in advance.
Cheers
Kannan
|
|
|
|
|
Hi Kannan,
Look in the "Project settings" for the "Post-build step" tab. Here you can add a list of commands you want to execute after a successful build.
I'm not sure, I used it only one time to copy a dll in the project directory. You may also use some special strings, see the docs.
Cheers,
Paolo.
|
|
|
|
|
You can set where the output executable/dll location in the "Link" tab in project options (Alt-F7)
..
|
|
|
|
|
I want to save and open different profile settings into different .ini files.
Is there an easy way to do this?
Also, how do I save the files?
File Save/File Save As... will prompt the user for an .ini file to save the attributes of fields from the dialog boxes.
Any help would be appreciated.
|
|
|
|
|
Look up the WritePrivateProfile*() APIs. The counterparts to read from INI files are GetPrivateProfile*().
|
|
|
|
|
Does anyone know where I can find a free Flowchart library or ActiveX ? Or is there anyone who can point to some information to write it myself.
|
|
|
|
|
Hi. I know this is going to sound like a plug, but here goes.
First, I'm not aware of any freeware, or opensource object/relationship diagramming libraries. There are a number of commercial offerings, from companies like Northwoods, Protoview and (I think) Tom Sawyer, but the prices can be pretty darn hefty.
Microsoft's Visio has a programming model that you can develop against, and it's very good. Depending upon your needs, and the extent to which you intend to distribute your software, this could be an option. Many people however aren't comfortable building a dependance on Microsoft Office (or Visio) into their apps, but as I said you know your situation better than anyone.
We offer a few commercial libraries that support diagramming, one called Ultimate Diagram, and a superset of that called HyperView.
Right now, we're offering these libraries, along with the whole complement of our MFC development libraries, complete with full source code in a special product bundle called the Goldrush 2000. I'd recommend you check it out to see if it fits your needs. I guarantee it will be the least expensive way to grab a diagramming library!
http://www.dundas.com/goldrush2000
|
|
|
|
|
Hi!
I'm looking for a function or a method to get the volume bitmap, which works with Windows NT 4.0.
I tried to use the function DeviceIoControl(...) with file system control code FSCTL_GET_VOLUME_BITMAP. But this system code requires Windows 2000.
Who can help me?????
Thanks a lot
Bernhard
|
|
|
|
|
When you close a print preview, by clicking the close button on the top right of the window, The CMainFrame::OnClose() is called. Is there anyway of detecting, within onClose(), whether OnClose() has been called from the printpreview (CPreviewPage) or from the mainfram?
|
|
|
|
|
GetWindowText() only applies to child controls in the current process. Are there any methods that I can read the text of the child controls in another applications?
Thanks all!
|
|
|
|
|
GetWindowText() works on any window.
|
|
|
|
|
How about other common controls like listcontrol, treecontrol? Can I access the tree control in windows explorer through my program?
Thanks all!!
|
|
|
|
|
GetWindowText() only applies to child controls in the current process. Are there any methods that I can read the text of the child controls in another applications?
Thanks all!
|
|
|
|
|
I want to get Ecash source code
who does have E-cash source code, sends me that code please!
thank for anyone!
|
|
|
|
|
I need to be able to have one application monitor and control the behaviour of another Windows application. Sadly I don't have the source for that app. nor is the producer for the app. prepared to provide an interface for what we need to do. I thought therefore that maybe the way to get round it is to use and interface similar to what Visual Test uses. Does anyone out there have an idea where I may find sample code to do this or suggestions on the best way to tackle this. Is it possible to hook into another apps message loop and intercept and retrieve messages to acchieve this?
Thanks in advance.
Happy programming!!
|
|
|
|
|
I need to be able to have one application monitor and control the behaviour of another Windows application. Sadly I don't have the source for that app. nor is the producer for the app. prepared to provide an interface for what we need to do. I thought therefore that maybe the way to get round it is to use and interface similar to what Visual Test uses. Does anyone out there have an idea where I may find sample code to do this or suggestions on the best way to tackle this. Is it possible to hook into another apps message loop and intercept and retrieve messages to acchieve this?
Thanks in advance.
Happy programming!!
|
|
|
|
|
as title.
thank you for any respnse!!
|
|
|
|
|
Simply add your executable filepath in the following registry place:
Current_User -> Software -> Microsoft -> Windows -> CurrentVersion -> Run
|
|
|
|
|
This may be a stupid, stupid idea, but I have several VB6 ActiveX DLLs that I would *like* to be able to access from a C++ app. The reason being that I have a lot of classes that access our database in those DLLs that I need to be able to access and use in an NT service. From what I've read, there's really no good way to create a service from VB, so I plan to do it in C++. All the examples I've found make it look really easy, however when I #import the DLLs (and create the .h and *_i.c files with the MIDL compiler) there are a lot of objects that don't seem to get defined. These objects are in DLLs that I don't control (i.e. CDO.DLL, MSRDO20.dll, excel98.olb, MSVBVM60.dll) Is there a good way to import a DLL and not have to worry with the DLLs it depends on? It would seem like the DLL you are importing would have to take care of that itself?
This all may be a horrendous idea anyway, but I hate to reprogram DB routines that already work in a new language.
Any input is appreciated.
|
|
|
|
|
When running regsvr32 from Start .. Run, the application starts up correctly. However, if I build an ATL object, the registration fails stating it doesn't recognise the batch file. Any ideas ?
Thankyou
|
|
|
|
|
I have an ATL COM object that implements two custom interfaces and IDispatch. I can simply CoCreate the object from a C++ console app but when I try to expand the object within the debugger (to see whether IDispatch and IUnknown are inherited correctly), the development environment crashes and Spins up another instance of MSDEV with assembly in it.
Has anyone seen these symptoms before ? Any ideas ?
Thanks
|
|
|
|
|
I want to concatenate two files like Dos prompt.
Example :
COPY File1.txt+File2.txt File3.txt
Thanks in advance
|
|
|
|