|
thanks for the info... ill leave the fix for a later date
r -€
|
|
|
|
|
I use Visual C++ 6.0. I want to link my MFC application staticly instead of using shared DLLs. If I go to Project->Settings->General I can ONLY chose "Use MFC in a shared DLL". What's wrong?
|
|
|
|
|
|
|
::VkKeyScan translates a character to the corresponding virtual-key code and shift state for the current keyboard, but which function does the reverse and translates the VK code and shift state to a character, is there any? Thanks.
|
|
|
|
|
|
ToAsciiEx / ToUnicodeEx .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
i want to make a keyboard driver. my aim is to type any Indian languages in ms word or excel or notepad etc.what are the code words for hooking ( trap ) a key stroke and post it to a desired application. i have some idea first we have to get the focus of the window ( get focus api) then each keystroke has to be trapped and converted to their ascii. Then using post message api converted ascii is passed to the input focus window.
but i am not sure, pls give me a small program by which when we type 'a' in the keyboard we must get 'b' in the desired window. thanks
|
|
|
|
|
I think you will need to install a keyboard hook. Check ::SetWindowsHookEx .
|
|
|
|
|
I'm trying to display a small icon in a CStatusBarCtrl. I created a 16x16 icon, IDI_X, in the resource editor, then I tried the following:
HICON hIcon;
hIcon = theApp.LoadIcon(MAKEINTRESOURCE(IDI_X));
m_wndSBC.SetIcon(0, hIcon);
The icon is resized to 32x32 and doesn't fit in the status bar. The CApp::LoadIcon documentation says it can only be used to load an icon whose size conforms to the SM_CXICON and SM_CYICON system metric. It says to use LoadImage instead. So, I tried this:
HANDLE hIcon;
hIcon = LoadImage(NULL, MAKEINTRESOURCE(IDI_X),
IMAGE_ICON, 0, 0, 0);
DWORD dwError;
dwError = GetLastError();
That didn't work either. LoadImage returns NULL and GetLastError returns 1813: "The specified resource type cannot be found in the image file."
Can anyone help?
|
|
|
|
|
Just an update. I got it to work by doing the following:
HANDLE hIcon;
hIcon = ::LoadImage(NULL, "res\\icon1.ico",
IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
m_wndSBC.SetIcon(0, (HICON) hIcon);
But I'd still like to know why it didn't work the other way, if anyone can help.
Thanks.
|
|
|
|
|
|
Hmmm... I'm still getting the same error 1831. What am I doing wrong?
m_hIconX = LoadImage(NULL, MAKEINTRESOURCE(IDI_X),
IMAGE_ICON, 16, 16, 0);
DWORD dwError;
dwError = GetLastError();
|
|
|
|
|
|
Thanks, Mike! That did the trick. Much appreciated.
|
|
|
|
|
Hi Barvus,
An unrelated coment to your problem, I saw you used GetLastError() just to check what was wrong with the LoadImage call, good news for you, you don't have to type those two lines ever again, you can check the registers and pseudoregister and see among other things, the last error directly, to better undestand what I'm talking about, check this article
An introduction to debugging in MSVC++ using Pseudoregisters
By Wouter Dhondt
Fabian
|
|
|
|
|
Hey, thanks for the tip! Good to know. I wonder why that's not documented in MSDN.... Or is it? Must be buried somewhere deep.
|
|
|
|
|
|
i want exercise iostream also support the file's input and output,so write the little program below,but after compile ,note"error C2065: 'String' : undeclared identifier",can you help me to solve it?
the program function is:read word from a text file named "in_file",and write every word into a output file named "out_file" .
#include<iostream.h>
#include<fstream.h>
#include<string.h>
int main()
{
ofstream outfile("out_file");
ifstream infile("password");
if(!infile)
{
cerr<<"error:unable to open input file!\n";
return -1;
}
if(!outfile)
{
cerr<<"error:unable to open output file!\n";
return -2;
}
String word;
while (infile>>word)
outfile<
|
|
|
|
|
try
#include <string><br />
using namespace std;<br />
<br />
string word;
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
yes,but when to use namespace?
in addition,why to note "unable to open input file",in_file is a txt created by notepad?
|
|
|
|
|
Reposting your includes:
#include <iostream.h>
#include <fstream.h>
#include <string.h> You have a few problems here. First, you are using the old iostream headers instead of the STL ones. Change them to <fstream> and <iostream> without the .h extension.
Also, string.h is the C library header with the C-style string functions. You want to #include <string>
Next, the type is string not String .
And finally, as the other post said, you need to use the std:: namespace name before the types because STL types are in that namespace.
More details on the iostream vs. STL headers here[^]
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
#include "witty-quote.h"
|
|
|
|
|
Using Visual C++ .net 2003, how would i put a .dll inside a .exe and have it run? Example Run.exe uses Running.dll to run, but i want it to be just the Run.exe with the running.dll inside of it? How would i do that? Also please give me detials on exactly how to do it.
|
|
|
|
|
do it the same way as sysinternal tools do. put the dll as resource into the exe file, extract it when running the program and load it dynamically then.
Don't try it, just do it!
|
|
|
|
|
Can you email me at mikeza123@comcast.net i need more info, im not to good at this. Tell me as if you were talking to a newb coder
|
|
|
|