|
Haven't been coding C for awhile --- I want a string tokenizer, any good suggestion? Thanks.
Norman Fung
|
|
|
|
|
Hi,
Try this:
char *strtok(
char *strToken,
const char *strDelimit
);
-----------
Mila
|
|
|
|
|
How to use WM_SYSKEYDOWN for Alt+Selection?
|
|
|
|
|
Hello ,
Choose the "PreTranslateMessage" function of your dialog class from ClassWizard and include the following code in it...
BOOL YourDlgClass::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_SYSKEYDOWN) // ALT key combinations
{
switch (pMsg->wParam)
{ // ... case statements for each key being trapped
case 'T' : //for key combination ALT + T
//write your code here
break;
default : // unhandled keystroke
return CDialog::PreTranslateMessage(pMsg);
break;
}
return TRUE; // msg is processed
}
return CDialog::PreTranslateMessage(pMsg);
}
vinsankar
|
|
|
|
|
Hi all,
I have a MySQL server running on a linux that is working properly, and i have errors trying to connect to the server on a windows NT client using ODBC. The error i am getting is Can't connect to MySQL 10060. The driver i am using is ODBC 3.51,(i wish to create a vb app using the driver to access the database) I am quite sure that the parameters that i specified for the host name etc are correct. I even downloaded the MySQL control centre to test the connection to the MySQL linux server, but it still doesnt work. I tried using the same ODBC driver and the same windows client to connect to another dummy MySQL server running on a remote windows PC and it works. Also I have a website coded in PHP that can access the MySQL database on any windows pc, so it couldn't possibly be that the MySQL server blocks out my clients IP address right?
Please help Thanks in advance
andy
-- modified at 1:35 Monday 27th November, 2006
|
|
|
|
|
firebow3007 wrote: i wish to create a vb app using the driver to access the database
Wrong forum.
firebow3007 wrote: I even downloaded the MySQL control centre to test the connection to the MySQL linux server, but it still doesnt work.
Sounds like IPTables or some other firewall (is there even another firewall for *Nix) is blocking access to the *Nix server. Check the firewall settings...
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hi,
I want to know whether it's possible to use a activex control in a dialog that is inside a MFC extension DLL?
I used the crystal reports viewer control in a CDialog and wrote in the InitInstance to open a report file and store the report pointer in a member variable (to get it later). But the problem was, when i debug it seems the controll never goes to InitInstance. Then i overrided the DoModal method and put the same code there; but still the report doesn't seem to open. I have the same code perfectly working in a non DLL project. I thought this is something wrong with the project settings becos the AppWizard never asks whether i want to use Activex controlls.
Any Crystal Reports experts please help.
Any other experts pls answer only to my first question..
|
|
|
|
|
Question 1
In my program (a MFC project), how to obtain the status of system memory, say, available mem space, etc.
Question 2
How to obtain the ProcessID of my program . I would like to use the ProcessID in the program.
|
|
|
|
|
Hello,
you can use the following function to get the process ID.
DWORD GetCurrentProcessId(VOID);
The GetCurrentProcessId function returns the process identifier of the calling process.
Use the following function to get the System Information,
VOID GetSystemInfo(
LPSYSTEM_INFO lpSystemInfo // system information
);
This function returns information about the current system.
Search MSDN , If you want to know more about these functions.
vinsankar
|
|
|
|
|
you can use GlobalMemoryStatus for getting info about available mem space
|
|
|
|
|
Hi
How can i write a mouse driver for PS2 mouse.
This driver should run on any platform.
I it is by using DDK, then please direct me to some link wer from i can get it free.
hope to get some answers soon
bye
pitchu
|
|
|
|
|
Why do you need to write a PS2 mouse driver as that comes with windows. If you need a filter driver you can use src\input\moufiltr example in DDK source. that will help you alot to start with.
Dhirendra
|
|
|
|
|
can anyone show me how to include a precompiled header file in my program??? thanks...
---------------------------Life is simple, you just complicate it----------------------------
|
|
|
|
|
you set this up in your project settings. It's usually called stdafx.h, but you can include precompiled headers with any name, in your settings. If you get an error regarding precompiled headers, chances are you have at least one file that doesn't include stdafx.h. You need to include it first, anything included before it, is ignored.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian Graus wrote: You need to include it first, anything included before it, is ignored.
Forgive me for sounding stupid, but if I include headers in the following manner:
#include <someheader.h><br />
#include <stdafx.h>
The someheader.h file would not be included?
|
|
|
|
|
That's my understanding, yes.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
No, the other header is included, but depending on what is in the other header it may end up with a bunch of undefined symbols. If you are using MFC for example, all the MFC stuff gets included via the precompiled header. If the other header is included before stdafx.h and it uses MFC with out explicitly including stdafx.h itself it will cause errors.
I hope that was clear enough
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Actually, the compiler ignores everything before the #include "stdafx.h" line. Try it - stick gibberish there and it'll compile just fine (in VC6 at least, I haven't tried it in 7/8).
|
|
|
|
|
Yeah, I just tried it in VC8. Same thing. The compiler completely ignored the gibberish I typed in there. Just when I think I might know what the heck I am talking about I get shown how wrong I am
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Hello everyone:
I want to connect to mysql in a long-range computer that use unix OS,my OS is windows NT
When i input the order c:/mysql/bin/mysql -h192.168.11.5 -uruitech -p enter ******(the pw),there is a error happen:
ERROR 2003 (HY000):Can't connect to MySQL server on '192.168.11.5'(10060)
I was puzzled,the long-range computer has commision others to access its mysql DB.and it's works well.
I need help~~~
Thanks in advance!!!
Henry
-- modified at 23:39 Sunday 26th November, 2006
|
|
|
|
|
I'm not an expert on MySQL, but based on my experience with SQL Server I would suggest finding out what ports MySQL uses to listen for incoming connections and respond to clients. If these ports are being blocked by a firewall on either the client computer or the server, you won't be able to connect. Try turning off any firewalls (temporarily) and see what happens.
Scott
|
|
|
|
|
Need 2 design a C program to copy a log file from database (Timberline) into a text file and it has to get auto updated as per the log file modifications.
Thnx in advance !!!
|
|
|
|
|
nimmi_friends wrote: Need 2 design a C program to copy a log file from database (Timberline) into a text file
Sounds like fun. Good luck!
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
I wrote a function that open a registry key and than query some values - in fact there were three. Having full rights on it I observed something strange:
- the key opened successfully
- the first value failed to read
- the next two read OK
I tried to change the order of the values, but same result.
Each time the first read failed and returned error 234 -
//
// MessageId: ERROR_MORE_DATA
//
// MessageText:
//
// More data is available.
//
#define ERROR_MORE_DATA 234L // dderror
/* from winerror.h*/
I tried to reread the value after the failed attempt and - surprise - it worked! Why?
And what means the error code obtained first?
|
|
|
|
|
You aren't initializing the parameters properly. Mostly likely, the parameter that indicates the size of the buffer you're providing for the data isn't initialized, or is initialized to 0.
Oh - and i have winerror.h . I don't have your code. Given that the problem is in the latter, it would be a good idea for you to post the relevant portions of that next time, rather than the system header file.
|
|
|
|