|
If you do the follwing in VB6
<br />
Dim myVar as Boolean<br />
myVar = True<br />
<br />
Debug.Print myVar<br />
you'll see a 'True' in the debug window, but only on an english system, the string is actualy language dependent.
My problem now is that I need to read a text file that was written with VB6 with C++.
Therefore I need a list of the languages VB6 was shipped and the used strings to represent the value of a Boolean.
I know that this is more a VB than C++ question, but I don't know any good VB forum
Thanks
|
|
|
|
|
ABuenger wrote: but I don't know any good VB forum...
Including this one?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Including this one?
I thought it is only for VB.NET
|
|
|
|
|
i have displayed the valuess from database. when i change the TAB IN DIALOG it should not read from database.it should store the values in local structure.and when ever the TAB changes it display the values from the structure.how it is possible?
|
|
|
|
|
Arul Joseph wrote: when i change the TAB IN DIALOG...
What tab? Is this with a property sheet, or a tabbed dialog? In either case, once you add items to a list control, those items remain even as you select other tabs.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
tabbed dialog. first it read it from MS-access database and store it local structure.Then we take the data from that structure.dont refer every time to database.How to store in local structure?
|
|
|
|
|
Arul Joseph wrote: dont refer every time to database.
There shouldn't be a need to. What makes you think otherwise?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
Where can I download SDK for crystal report 10??
Thank you.
|
|
|
|
|
Somehow, I've lost the controls palette used for creating controls on a dialog box. How do I get it back?
Thanks in advance.
John P.
|
|
|
|
|
Go to Tools --> Customize --> Toolbars tab
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Right click on the tool bar and check on the option controls to get the controls palette
|
|
|
|
|
Does a setup file of an application created to be distributed via a CD differ from one created to be distributed via the web?
Fortitudine Vincimus!
|
|
|
|
|
No it need not be. Atleast we haven not used a different setup file for CD and a different setup file in the web. The only additional stuff in the CD could be the Autorun file which will be absent in the web.
HTH
|
|
|
|
|
Thanks.
Fortitudine Vincimus!
|
|
|
|
|
I have created a DLL (Hook.dll) in unicode using .net 2003. The builder use vc++. I am loading the dll dynamically with an hook into a target process (Main.exe) with an dll injector.
BOOL APIENTRY DllMain (HMODULE hDll, DWORD reason, PVOID lpReserved)<br />
{<br />
if(Reason == DLL_PROCESS_ATTACH)<br />
{<br />
DisableThreadLibraryCalls(hDll);
I have a function within the DLL(Hook.dll) that tries to get the DLLs(Hook.dll) file name and path (fullpath with filename of Hook.dll).
this is the original code, this code gets and reads the crc32 checksum of the Main.exe:
pEXEFile = fopen(pszEXEFileName, "rb");
now i have changed it to and can fopen and read the dll, when i use::
pDLLFile = fopen("C:\\Documents and Settings\\Shawn\\Desktop\\Hook.dll", "rb");
this code above works, it will open my dll and read it's crc32 checksum, when i place and load the dll from my desktop.
another code that works:
pDLLFile = fopen("\\Hook.dll", "rb");
this last code above works, when i move the Hook.dll into the same folder where the Main.exe is.
I thought that because I used LoadLibrary to load the DLL that it would be
in its own application space. So I figured I could just use the DLLs
Application component to extract the file name using GetModuleFileName
However, I was supprised to find that the returned name was the main
application not the DLL.
Is there another way to get the DLLs files name when dynamically loading it or is their a better way to use GetModuleFileName?
The problem is I do not know what directory the DLL was in when i inject the dll into the main program and I need to figure this out at run time.
what im trying to do is, get the fullpath to the injected dll at runtime, fopen the dll then to read it in binary mode and get a crc32 hash from the dll, check the retrieved crc32 checksum and validate the dll, if the dll was altered, exit the Main.exe.
i got some example code and need now some help, how could i bring the code to give me the fullpath of my loaded module "Hook.dll" from the Main.exe
example codes:
extern HINSTANCE _hInstance;<br />
<br />
const char *OurFileName()<br />
{<br />
static char our_filename[MAX_PATH + 1];<br />
<br />
if (!*our_filename)<br />
{<br />
GetModuleFileName(_hInstance, our_filename, sizeof(our_filename);<br />
}<br />
<br />
return our_filename;<br />
}
You can do something like this to get path of a loaded module: <br />
<br />
HMODULE hmod = NULL; <br />
<br />
LPCTSTR lpszModuleName = TEXT("MyLibrary.dll"); <br />
<br />
TCHAR szPath[MAX_PATH + 1] = {0}; <br />
<br />
hmod = GetModuleHandle(lpszModuleName); <br />
<br />
if (!hmod) <br />
<br />
<br />
GetModuleFileName(hmod, szPath, MAX_PATH); <br />
<br />
FreeModule(hmod); <br />
<br />
This copies path to the module into szPath.
Thanks for every help
Shawn
|
|
|
|
|
I'm coding a program which gives a stimuli and wait for the user's answer before giving another one. The user answer by pressing one of 2 keys, and at the moment the program seems to be storing extra key pressed for the next stimulis. For example, if the user is asked to answer a question but presses twice the key, the second hit is used to answer the next question. Could anyone point me to a way of flushing all these keypresses before asking the user for the real one? Thanks in advance,
I'm using a windows form and the KeyPress event handler (which I'm really not yet comfortable with) and visual c++ studio express
//Code in the form1 constructor :
this->KeyPress += gcnew KeyPressEventHandler(this, &Form1::Form1_KeyPress);
Form1::KeyPreview = true;
//Code for the function
void Form1_KeyPress(Object^ sender, KeyPressEventArgs^ e)
{
// Here I handle the key
}
Simon
|
|
|
|
|
i wonder if someone could help me with an issue im having converting a hex value to a binary string..
i am trying to convert the hex string 0x00C000000000 to binary which should work out to be 1100000000000000000000000000000000000000.
i am using std::stringstream to fist convert the hex value to decimal and this is where it seems to be failing.. for the hex string 0x00C000000000 the decimal equivalent should be 824633720832 but i am not getting that..
here is my code
<br />
<br />
std::string hexvalue = "00C000000000";<br />
std::string binary = "";<br />
<br />
long decimalVal;<br />
<br />
std::stringstream sstr(hexvalue);<br />
sstr >> std::hex >> decimalVal;<br />
<br />
std::ostringstream out;<br />
long digit;<br />
bool nonzero = false;<br />
<br />
for (long i = 31; i >=0; i--)<br />
{<br />
digit = (decimalVal >> i) & 1 ;<br />
if (!nonzero && digit)<br />
nonzero = true;<br />
<br />
if (nonzero)<br />
out << digit;<br />
}<br />
<br />
binary = out.str();
by the way, if i set hexvalue to a smaller number then it seems to work. for example.
std::string hexvalue = "12";
can anybody help me out here?
thanks in advance
|
|
|
|
|
doh!!! im a muppet... its always the way isnt it.. no sooner than you ask for help to a problem then you realise what your doing wrong! hehe
as soon as i hit the send button i realised my small "long" was to small, and so ive changed it to __int64 and all is sound!! - ignore me all
std::string hexvalue = "00C000000000";<br />
std::string binary = "";<br />
<br />
__int64 decimalVal;<br />
<br />
std::stringstream sstr(hexvalue);<br />
sstr >> std::hex >> decimalVal;<br />
<br />
std::ostringstream out;<br />
__int64 digit;<br />
bool nonzero = false;<br />
<br />
for (__int64 i = 50; i >=0; i--)<br />
{<br />
digit = (decimalVal >> i) & 1 ;<br />
if (!nonzero && digit)<br />
nonzero = true;<br />
<br />
if (nonzero)<br />
out << digit;<br />
}<br />
<br />
binary = out.str();
-- modified at 11:26 Monday 7th August, 2006
|
|
|
|
|
Hello,
How can change the working directory of NT service from WINNT\system32 to the
exe directory (C++ unmanaged)?
Thanks,
|
|
|
|
|
|
Use GetModuleFileName(NULL, ...) to get the EXE's folder. Use that with SetCurrentDirectory() .
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
If you are bent at using crt routines, then _chdir would do that. Be aware that this routine would internally call the win32 api, SetCurrentDirectory.
|
|
|
|
|
See
SetCurrentDirectory(for set directory)<br />
GetCurrentDirectory(for get current directory)
|
|
|
|
|
We recently switched a rather large project (7 projects in this workspace) from VS2002 to VS2005. This was in anticipation of supporting 64-bit apps, so we had a lot of details to straighten out before we had a working build.
Once the dust had settled, I realized that the browse info for the system no longer works. Whenever I click a symbols name and press F12, for a symbol defined in one of our projects, I get the message "The symbol 'whatever' is not defined." Symbols defined by MFC are handled correctly.
Now, the wierd part: the settings for browse info are all correct, as far as I can tell; I get the correct progress message when thge browse info is created; and the browse info files are where they should be (in the same directory as my .objs). But for some reason, VS2005 can't find them!
Any idea what might be wrong here?
|
|
|
|
|
I am dynamically adding content to a CDialogBar - when the on-screen capacity is reached i want to add a scrollbar to allow the content to be visable.
I understand that CDialogBar will not allow a Scrollbar - so i'm not really sure what to do. I'm quite limted with a CDialogBar as i need it as part of MDI.
Any help appreciated!
-- modified at 11:05 Monday 7th August, 2006
|
|
|
|