|
Thank you very much for your explaining and suggestion.. I'll learn about STL..
Thank you Chris...
|
|
|
|
|
Glad to help.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
whats wrong with my string?
I am trying to find a record in a database where one parameter is partially given ( LIKE 'm_val'). I don't get any database errors, but no info either.
CString m_cat, m_val;
// Build the SQL statement
SqlString = "SELECT * "
"FROM new WHERE cat='";
SqlString += m_cat;
SqlString += "' AND filename LIKE '";
SqlString += m_val;
SqlString += "*'";
Any helps really appreciated
shotgun
|
|
|
|
|
I believe the wildcard character is %, that is, I know % works, but I've never tried *. Do your values start with m_val, the ones you expect to find ? Are they in the table called 'new', and in the 'filename' column ?
I find the best way to isolate this sort of problem is to build the query. Do a select *, a select cat, a select * where cat equals a known to be present value, etc.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian is right - '*' won't work as a wildcard but '%' will.
-Alex;)
|
|
|
|
|
On MSDN, in documenation for API structures, the following examples are common:
typedef struct _RASDIALPARAMS {
DWORD dwSize;
TCHAR szEntryName[RAS_MaxEntryName + 1];
TCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1];
TCHAR szCallbackNumber[RAS_MaxCallbackNumber + 1];
TCHAR szUserName[UNLEN + 1];
TCHAR szPassword[PWLEN + 1];
TCHAR szDomain[DNLEN + 1] ;
#if (WINVER >= 0x401)
DWORD dwSubEntry;
DWORD dwCallbackId;
#endif
} RASDIALPARAMS;
Apparently (WINVER >= 0x401) refers to Windows NT 4.0 with enhancements and on this platform, the last 2 entries are required. However, Windows 98, whose version is 4.10 doesn't require them ...
Isn't 4.10 > 4.01? Or am I not understanding something?
Thanks
A reasonable man adapts himself to the world. An unreasonable one persists, trying to adapt the world to himself. That is why all the progress in the world depends on the unreasonable men.
|
|
|
|
|
The project is to simulate a Finited State Machine running with a specific input sequencr. Just highlight the path it goes through.
The problem is to set a Pause button to stop and restart it. How??? Do I has to use thread?? If yes how to
( My view class is base on CScrollView )
Thanks!!
|
|
|
|
|
Does anyone know of a function/routine to tell me how many files are on a disk drive? Can't find anything in MSDN.
|
|
|
|
|
I would use the FindFirstFile and FindNextFile .
You specify "*" as filter and then count the files. This way you also can count only specific files with specific extensions, or only count directories.
I don't know of any function which directly returns the number of files on a drive.
-Dominik
|
|
|
|
|
Thanks for the help. I thought of also doing that but it would be pointless since I need this number to be set for a progress bar which is active during searching of the hard drive for files so it kind of defeats the purpose of doing that twice...any other ideas?
|
|
|
|
|
Another idea:
First step: Get the used size on the disk (capacity minus free space). Use this function:
BOOL GetDiskFreeSpaceEx(<br />
LPCTSTR lpDirectoryName,
PULARGE_INTEGER lpFreeBytesAvailableToCaller,
PULARGE_INTEGER lpTotalNumberOfBytes,
PULARGE_INTEGER lpTotalNumberOfFreeBytes
);
Second step: Every time you process a file, subtract its size from the space.
Now you can compute the remaining bytes to process. Set this into relation and make a nice status bar.
-Dominik
|
|
|
|
|
Thanks, that should do it...why didn't I think of that?!
|
|
|
|
|
Sorry to bother again but I seem to be running into a problem with the GetDiskFreeSpaceEx function:
This is what i used:
GetDiskFreeSpaceEx("c:\\", &iFreeBytes, &iTotalBytes, &iTotalFreeBytes);
and these were my results:
iFreeBytes = 1711489024
iTotalBytes = 0
iTotalFreeBytes = 1697718272
Can't really figure out the problem...right clicking on drive c in explorer gives me freebytes as above (the first arguement) and for the drive capacity i have 5,992,685,568 bytes. Is there anything that I'm overlooking?
|
|
|
|
|
When you print the results you can't just use %d specification since you're dealing with 64-bit values. Try a format string of "%I64d" and I'm sure you'll see quite a change.
|
|
|
|
|
Hello,
I have a problem. I want use the glGetString function to get the vendor, version and extension strings. But this doesn't work.
My project does not need an OpenGL window. I don't need to draw anything. I just want the information by glGetString. You can think of a system information tool.
I LoadLibrary("OpenGL") the OpenGL library and then get the function using GetProcAddress(g_hOpenGL, "glGetString") .
But glGetString always returns zero.
If I replace "OpenGL" with "GLU32", and replace "glGetString" with "gluGetString", so not using the main OpenGL library, but instead the utilities library, the functions work fine.
But the utilities library supports fewer information (just version and extensions).
How can I get the glGetString function work?
Do I have to initialize a window to make the glGetString function work? Or did I miss something?
Any idea?
Thank you!
-Dominik
|
|
|
|
|
Was "OpenGL" just a typo?
You should LoadLibrary("OpenGL32.dll") and nothing else.
Also, if you always need to do this you could equally well statically link with the opengl32.lib import library and get rid of the LoadLibrary and GetProcAddress calls.
|
|
|
|
|
Can anyone tell me a function/routine to find out the number of files on my hard drive...I didn't find anything in MSDN...Thanks is advance.
|
|
|
|
|
|
This is a programming question - how ?
The reason is that people have been coming onto CP and downloading the whole site, which is expensive for the site and not the idea of the site.
Personally, I think it's great. I don't get why people would be so lazy as to not create an account. It costs nothing and does not even require a valid email address. If you're not going to participate in this site at all, and just take the code provided, that's fine by me ( really ), but why wouldn't you at least give Chris another number to show potential advertisers how much traffic the site gets. It's the least you can do for the amount of free code you're able to download here.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
good then I do not spend my time as unregistered anymore.
|
|
|
|
|
Glad to hear it.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
I will not answer to this....
but only because I like to keep away flamebates from this forum and appreciate a friendly surrounding.
|
|
|
|
|
Anonymous wrote:
but only because I like to keep away flamebates from this forum and appreciate a friendly surrounding.
What is your problem ? You said you were not going to post anonymously anymore ( I presume now you were being sarcastic ), and I took it in good faith and said I thought it was a good thing that you create an account and put your name to your opinions. Actually, all I said, with those things in mind, was 'glad to hear it'. The possibility that you were being rude and sarcastic crossed my mind, but I gave you the benefit of the doubt, made an encouraging comment, and now I am trying to bait you ?
Every time I try to be nice to anonymous posters, I am left with a stronger opinion that anonymous posts should be banned and a valid email address required to create an account. I'd also bar hotmail et al. I think people would be less arrogant if they knew that when they said something, people who read it would be able to reply, and would know who they were.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi
i need to write programs using viusal c++ but i do not know the commands to use.
When i read the explainations from the MSDN library the terms used are very technical.
i need to know
1)how to read texts from the .ini file,
2)create directories
3)compare files
4)move files and store them to specific directories.
5)check time
Where can i find a simple book or web site that explains in simple terms.
Thks
|
|
|
|
|
needhelp ;(( wrote:
i need to write programs using viusal c++ but i do not know the commands to use.
When you say need, why ? Is it for school ? Do you have a one off project you need to complete for some other reason ?
needhelp ;(( wrote:
When i read the explainations from the MSDN library the terms used are very technical.
Yeah, that's called C++. Actually, a lot of the MSDN examples are in C, so they can be used by all Windows programmers, even those living in the dark ages.
needhelp ;(( wrote:
Where can i find a simple book or web site that explains in simple terms.
My first book was 'teach yourself C++ in 24 hours'. If you're looking to connect the numbers to get a simple windows app going and not really learn how to program ( and that's fair enough if you don't intend on coding again ), then 'teach yourself visual c++ in 24 hours' is a good starting point.
What's your reason for needing to do this, obviously without any background or experience ? What time frame do you have ? There are websites where you can pay people to write a one off project for you, that may be an option also, depending on your circumstances. If however you want/need to learn it yourself, those books are a good start, and you can always ask specific questions here when you get stuck. That's what I did.
Good luck.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|