|
oh, thank you. that is soooo much help.
C++ is a lot diff than VB6, and VB.net is kickin my butt, too. quite the learning curve.
Just a few seconds more, that's all I need. Close a door here, open a new one there, slip a bit of code off to the side to confuse the trail. The logout port is ahead... --«§øùl Ëס§†ëñçê»
|
|
|
|
|
No worries - glad to help. It is a big step to C++ from VB. I'd recommend C# over VB.Net, because that's where Microsoft's focus is going to be in the future.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
hi.
I wonder if there is any way to backup my registry using straight C++ 6 code or vb6 code. (I am using win 2000).
Ths.
|
|
|
|
|
Check out the Win32 registry API (RegEnumKeys, etc.) It's ugly, but will get you going. Note that if you are on Windows NT, 2000, or XP, you will have to be administrator to be able to read some of the keys.
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
Backing Up My registry using these Api functions is . I need something really simple.
|
|
|
|
|
To back up the whole registry, use the Windows NT Backup tool (Ntbackup.exe) and use the option to back up the registry. Or, run the rdisk /s command.
check msdn for details...
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
See RegSaveKey() in MSDN.
Respectfully, Igor.
|
|
|
|
|
Ths. This is very useful.
Anton.
|
|
|
|
|
Actually after i red about it, it is much less useful.
SaveKey/Restore Key save the Key Contents, but not the key itself neither its security and other attributes. .
Only Absolute Power and Absolutely No power matters. The rest is slavery.
|
|
|
|
|
When I execute these commands at the DOS prompt, they work just fine - i.e., a file called version.h is created. The file contains the line #define Major 4 .
C:\> set arg=4.5.2-RC8
C:\> for /f "delims=.- tokens=1" %i in ("%arg%") do @set major=%i
C:\> echo #define Major %major% > version.h
But if I put these lines in a CMD script (eg: createVer.cmd ) and execute it from the command line, I get the following error:
C:\> createVer
C:\> set arg=4.5.2-RC8
argi was unexpected at this time.
C:\> for /f "delims=.- tokens=1" argi
C:\>
Any idea what I'm doing wrong?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
The command processor does some bizarre read-ahead stuff which can lead to earlier definitions going crazy.
See help set for information on delayed environment variable substitution - basically, you surround the variable name with ! rather than % .
I'll admit that when I was trying to do something similar, I wrote a C++ program. It's a lot more controllable.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Thanks, Mike! I was able to fix it by using the %% notation (reqd in scripts).
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
It's a known issue with the command interp. Need to use %%i instead of %i when including commands in a script.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi People !
I ´m programming an 32 bit application that has to read a series of nunbers from a formated TXT file.
I was thinking about using fscanf but I realized that I need to open the file with fopen , that is an absolete function ...
Well.. I´d like to know if is there another alternative for fscanf , or if I can use fscanf even opening the file with CreateFile. Is there a new function to read a formated file , that is compatible with Createfile ?
Thank you in advande
|
|
|
|
|
|
Sorry !!!
I mean obsolete ...
Humm . I have heard about some people that had problems using it in 32 bit applications ...
|
|
|
|
|
arturapps wrote:
I have heard about some people that had problems using it in 32 bit applications
Which means they were not using it correctly. Being obsolete means that it is not available to use, correct or otherwise.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
arturapps wrote:
I need to open the file with fopen , that is an absolete function ...
What's obsolete about it? Are you using Visual Studio v7.x?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
i don't think fscanf is obsolete...
anyway, if you prefer the "younger" std::cin, you can thus read series of numbers too.
You will have to open a stream associated to your target file, and then do as much as cin as you want...
watch for iostream s in the msdn for details.
TOXCCT >>> GEII power
|
|
|
|
|
If you like, you can use a method other than fopen to open the file, read a line of text, and use sscanf to parse it.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
wasn't sscanf designed to read from strings ? (C-syle strings i heard)...
TOXCCT >>> GEII power
|
|
|
|
|
Sure, but it works just fine. The only problem with sscanf is that it is MUCH easier to shoot yourself in the foot or introduce buffer overruns.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
I'm confused. If you use CreateFile to open the file and ReadFile to read from it, you can use sscanf to parse the string you read.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I am developing software for a startup. However, I am not complete sure that I am developing it in the right language. We are currently using C#. The algorithm we are using to solve construction problems can have over 2,000,000 attributes. DO you think it would be better to code it in C++...My gut tells me yes..because I will be able to run linux clustered servers as opposed to windows servers.......
What do you think....Hong Kong Expat....http://sterlingwright.blogspot.com
|
|
|
|
|
Yes use C++ - C#'s advantage is that is highly geared towards the web. Number crunching is where C++ has a clear advantage, plus if you write it with non-MFC libraries it is portable
|
|
|
|