|
Your OS seems to not support the language for the folder containing your files, that's the reason why it can't see the folder in the first place. It is better to just change the folder name to english so that your compiler can see that directory, if it exists. But it might be possible that because your OS doesn't support that language, it can't show it in your PC. Why not just develop and run the code on an OS with the same language as the code your trying to develop, or add the language pack your OS needs to read that directory.
|
|
|
|
|
PLEASE read the forum guidelines. You have been told before not to use message titles like 'need help.' Everyone here needs help. Give your messages titles that are meaningful.
______________________
stuff + cats = awesome
|
|
|
|
|
how do I write to command prompt from a MFC dialog app? How can I get the "cout" object?
Thanks
|
|
|
|
|
|
Hi,
Description of first LoadKeyboardLayout() parameter:
pwszKLID
[in] Pointer to the buffer that specifies the name of the input locale identifier to load. This name is a string composed of the hexadecimal value of the Language Identifier (low word) and a device identifier (high word). For example, U.S. English has a language identifier of 0x0409, so the primary U.S. English layout is named "00000409". Variants of U.S. English layout (such as the Dvorak layout) are named "00010409", "00020409", and so on.
I can find language identifiers list in registry (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts), but where do I find "device identifiers" ??? Because now I'm able to set whatever language with default keyboard, but not specified keyboard( which is exactly what I want ).
thanks
Vilius
|
|
|
|
|
Hello, anytime i try to load a dll on another process (mainly games) i get an error, usually "OpenProcess Failed!" or "Failed to openprocess on ______". This has started to happen only about a month ago. I'm almost positive its something to do with my computer but im not sure what. Any help would be greatly appreciated! thnx
|
|
|
|
|
Have you tried using GetLastError() to get the exact error code?
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
srry im not sure how to do that. i didn't write the program and i have little to no background in this kind of stuff.
|
|
|
|
|
There is always a good time to learn!;P ==> ::GetLastError()
The error codes are defined in the "winerror.h" header file. You can also use the FormatMessage if you want to see a text description of the error.
<br />
std::string strMessage;<br />
<br />
HLOCAL hLocal = 0;<br />
::FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, 0,(DWORD)::GetLastError(), 0, (char*)&hLocal, 0, 0 );<br />
<br />
strMessage = (char*)LocalLock( hLocal );<br />
LocalFree( hLocal );<br />
|
|
|
|
|
srry for the stupid question but how do i look at the error codes in the "winerror.h" header file? honestly this is all a first time for me, thnx for the help though.
|
|
|
|
|
Jebus89 wrote: srry for the stupid question but how do i look at the error codes in the "winerror.h" header file?
Open the file using the IDE, or some other text editor such as Notepad.
Personally, I find that the simplest method to do this sort of thing is to add:
#include <winerror.h> someplace in the code, right click that statement, and select "Open" from the context menu. That'll save you from having to deal with a bunch of (messy) folder names.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
If you're using the Visual Studio debugger then just enter "@ERR, hr " in the watch window and let the debugger do all the heavy lifting.
Steve
|
|
|
|
|
If you aren't, then your compiler will have an "include" folder somewhere within it's parent directory.. Look in there.. "winuser.h" may be in another folder called "win" or in this directory.. i.e. it will either be in "[compiler root directory]\include\" or "[compiler root directory]\include\win".. If you still cannot find it, use the Windows search function (Press Windows key+F)
--PerspX
"Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
|
|
|
|
|
Can you show your code and also see here[^] im not sure its helpful or no.
|
|
|
|
|
srry if i didnt make myself clear, my problem is that i want to inject dll's into a game which recently i can't do because i get the open process failure pop up. the dll's / loader are not mine, i did not write them. all i did was download them. i know that it is something wrong with my computer that is giving me the "Failed to open process on _____" "OpenProcess Failed!" because it has been confirmed by hundreds of other people that the injector / loader works. This problem exists with any injector for any games. I have no prior background in programming so i'm srry if i posted this question in the wrong section but this community seemed to be really helpful so i posted in hopes that som1 could help me identify / fix the problem. thnx!
|
|
|
|
|
then you are in the wrong forum, this is a place for programmers asking other programmers programming questions....honestly i and other have no idea what level of knowledge you have and they are not going to waste their time answering the most primitives of questions,
who wants to keep hearing ya but i don't know how to do that..ad nauseam
sorry can't help you & good luck.
Yours Truly, The One and Only!
|
|
|
|
|
I know that it is possible to declare a class BEFORE the class has actually been constructed and defined. Here is an example:
int main()<br />
{<br />
class CHello;<br />
CHello tmp;<br />
return 0;<br />
}<br />
<br />
class CHello<br />
{<br />
}
As you can see, the line class CHello tell the compiler that such a class exists later on the code. However, how is it possible to declare the functions found within the class in the same way? I tried the code below, and it doesn't work.
int main()<br />
{<br />
class CHello;<br />
void CHello::create();<br />
CHello tmp;<br />
return 0;<br />
}<br />
<br />
class CHello<br />
{<br />
void create()<br />
{<br />
}<br />
}
Any solutions to this problem?
-- modified at 16:14 Sunday 8th July, 2007
Feed Launch .NET
|
|
|
|
|
No - forward declaring classes doesn't even work with your first example, I thought. The idea is you can forward declare a class if all you're doing locally is declaring a pointer, as a pointer has a fixed size in memory, and it can work out the size of the class later. I also didn't think you could declare a class inside a method ?
It's usually used if class A and class B hold references to each other, and so cannot include each others headers, as they recurse and blow up.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for the quick reply! I just tried the first example out, and it does work. However, thanks for clarifying when and when not to use forward class declarations. I'll try to use pointers instead!
Feed Launch .NET
|
|
|
|
|
When you forward-declare a class, you're just telling the compiler that the name CHello is a class name. You can't actually use CHello or a CHello variable until you define CHello . You can use a CHello* before the definition of CHello , but you can't dereference that pointer.
|
|
|
|
|
Given a HKEY, can the root and subkey hierarchy be determined? I tried using RegQueryInfoKey() using the lpClass parameter in the hope that it would work but it doesn't.
<br />
LPTSTR TempData[4096];<br />
DWORD TempSize = 4096;<br />
<br />
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows", 0, GENERIC_READ, &TempKey);<br />
RegQueryInfoKey(TempKey, TempData, &TempSize, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);<br />
None of the other registry access functions seem like what I need. I want to be able to take a HKEY as input and generate a string such as "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows" as output.
BTW, what is the lpClass parameter good for? Every HKEY I've tried causes it to return zero bytes of data (TempSize == 0). The function always returns ERROR_SUCCESS.
|
|
|
|
|
|
I am using LoadLibrary to load a dll and then export a function called MGetPixel from it. I load the DLL successfully but the GetProcAddress always gives me errors. Here is my code:
<br />
typedef COLORREF (*MYPROC)(HDC, int, int);<br />
HINSTANCE hinstLib = LoadLibrary("MacAPI.dll");<br />
MYPROC MGetPixel = (MYPROC)GetProcAddress(hinstLib, "MGetPixel");<br />
FreeLibrary(hinstLib);<br />
But when I actually go to use the API I get an error at runtime. Is there a problem in my declaration or the dll?
|
|
|
|
|
Assuming you're getting non-NULL return values from LoadLibrary() and GetProcAddress(), I'd say
the problem is in calling FreeLibrary(). Don't you want to keep the DLL loaded?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
This episode brought to you by the letter Z
|
|
|
|
|
Download a tool called "Dependency Walker". If you don't have a .def file being used by the linker, you'll see underscores '_' preceding each exported function name. To fix this, add a .def file to your project and then modify the linker properties to use the .def file (Definition file). Edit the .def file to have an EXPORTS section:
EXPORTS
FirstFunctionToExport
SecondFunctionToExport
ThirdFunctionToExport
....
You get the idea.
Also, as already mentioned, don't call FreeLibrary() until you are actually done with the DLL.
If this solves your problem, take some time to try to figure out mine above. I've already dumped a couple hours into it (mostly research - maybe 45 minutes of actual coding).
|
|
|
|