|
Easy only in VB.
Look at MSDN[^] for a C/C++ solution. (see the samples)
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
CSharedFile sf(GMEM_MOVEABLE | GMEM_SHARE | GMEM_ZEROINIT);
sf.Write(sString, strlen(sString));
if (sf.GetLength() > 0) {
OpenClipboard(AfxGetMainWnd()->GetSafeHwnd());
EmptyClipboard();
#ifdef _UNICODE
SetClipboardData(CF_UNICODETEXT, sf.Detach());
#else
SetClipboardData(CF_TEXT, sf.Detach());
#endif
CloseClipboard();
}
_____________________
"So in the interests of survival, they trained themselves to be agreeing machines instead of thinking machines. All their minds had to do was to discover what other people were thinking, and then they thought that, too."
Breakfast of Champions, Kurt Vonnegut
|
|
|
|
|
thanks heaps
luke.
|
|
|
|
|
What programming tools do you use? MFC makes working with clipboard very easy.
Kuphryn
|
|
|
|
|
I'm using LoadLibrary and GetProcAddress to pull a function from a DLL. This is working okay but when I call the function, I get this from the Debug Library:
"The value of ESP was not properly saved across a function call. This is usually a result of a calling function declared with one calling convention with a function pointer declared with a different calling convention."
Now I know this means that I'm using the wrong definition for my function pointer. Unfortunately, I don't know what the exact definition should be (and the person who can tell me is on holiday!).
I know that it's two strings in and an integer return. I've tried:
typedef int (*FUNCPTR1) (LPSTR Key, LPSTR Licensee);
typedef int (*FUNCPTR1) (LPCSTR Key, LPCSTR Licensee);
neither of which work.
So does anyone have any idea how I can extract the correct definition from the DLL?
Paul
|
|
|
|
|
|
Isn't __cdecl for in the DLL? I know it's being exported with the right name.
Where would I put __cdecl in the calling program?
Paul
|
|
|
|
|
In dll
void _stdcall aa(){};
In app
void(_stdcall* )() tmp = GetProcAddress(..);
i think above will pass
|
|
|
|
|
If I try any variation on this theme, I get "Syntax Error : ')'" on the closing parenthesis after _stdcall*
Paul
|
|
|
|
|
i'm sorry , should like this
void(_stdcall* tmp)() = GetProcAddress(..);
OR
typedef void(_stdcall* funType)();
funType tmp = GetProcAddress(..);
|
|
|
|
|
That's the answer I'm looking for. Thanks, that works great!
Paul
|
|
|
|
|
The fastest solution to this problem is by removing the "/GZ" from the "Project Options" listbox
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hmmm... yeah, I guess so. Unfortunately, I was using the debug version because the release version wasn't working properly either.
The problem I have is that I'm writing custom actions for Windows Installer DLLs; sometimes these call other DLLs from SUPPORTDIR because the Installshield wrapper for standard DLLs is really poor.
Unfortunately because we have many users who run Silent Installs, we have to be able to run the DLL without any visible output. So I have a release version that's simply forcing the installer into Rollback and a Debug version that gives me all the right message boxes but then crashes like this.
It's all kind of tacky but what can you do?
All sorted now anyway, just a missing _stdcall.
Paul
|
|
|
|
|
My vc6 always creates a project as a debug version. Is there a way to change the default to release version?
I've already looked inside tools->customize and tools->options but I can't find it.
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
Nope. You are expected to get rid of all bugs before release
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
Me never mistaking makes! Me is name Billy Gaytes...
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
Bill G. makes mistakes. But Bill S. doesnt
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
Who's Bill S??
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
search for Bill S in the lounge if you dare
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
Sorry i asked, didnt mean to bring u bad memory indeed
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
LOL
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
That setting is probably in the same place as the "don't make useless readme.txt files upon project creation" setting.
Seriously though, I don't know.
_____________________
"So in the interests of survival, they trained themselves to be agreeing machines instead of thinking machines. All their minds had to do was to discover what other people were thinking, and then they thought that, too."
Breakfast of Champions, Kurt Vonnegut
|
|
|
|
|
Does anyone know how to get the system time and store it in a variable in vc6? also, do you know how to get the country from the system and store that in a variable as well?
|
|
|
|
|
Have a look at GetSystemTime / GetLocalTime on MSDN.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
In my application, I'm using a TreeCtrl to display some hierachical information about the setting of the information.
I want it to be shown like:
[B] Solutions
|
---+[F] Solution Users
|
---+[F] Materials
I want Solution Users and Materials are not initially expanded (Items not populated until the + is clicked).
[B] and [F] here represents two images.
By the way, I don't know how to create image list for it, should i create a bit map of 2 x 16 x 15 to hold the images, and load it into CImageList, and set it to the tree ??
|
|
|
|