|
Hi all...
i want some exercises based on MS SQL northwind database for a training program..
can u pls send me any links / pdf /doc
very urgent..please help me...
Thanks in advance
renji
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
A server program that I have to deal with is slightly old and is not getting any further upgrades. Problem is that if someone tries to login to it using %s, %i, etc... then it crashes and has to be restarted, I am sure you all can figure out why that is. I either need to make a small program to watch for the login packet and drop it when % is detected in the name, since they would not be their anyways. I already have the packet structure and it is uniform for all logins so it would be simple to just do a couple compares of the packet array to see if it needs to be dropped. Does anyone have any thoughts, code, etc for a simple way to achieve dropping a packet with specific data, preferably heading to a specific program?
|
|
|
|
|
if you overload a function with "signed char" instead of just "char" and another with "signed int" then call it with 'c' as a parameter, the "signed int" one gets called, not the "signed char" one. Is this a bug in VC++, or is it supposed to work that way?
|
|
|
|
|
AFAIK that is standard behaviour. The compiler treats the 'c' as an int. To get around this you have to cast the 'c' to an signed char.
MyFunction((signed char)'c');
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
um... just putting "char" instead of "signed char" calls the "char" one (not the "int" one).
VC++ doesn't seem to treat 'c' as an int:
puts( typeid('c').name() ); // prints "char"
puts( typeid('cc').name() );// prints "int"
do the c++ standards say to? do you know if other compilers do?
-thanks
|
|
|
|
|
The default char type may be unsigned.
This can be controlled by compiler flags.
In that case using 'char' and 'c' works because there is no conversion.
Using 'signed char' and 'c' makes the compiler look for the best conversion from (unsigned char) 'c'. In that case i guess it promotes 'c' to a signed int.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
I want to implement Process Communication in visual C. Like if a process is running, i want to write a code which can cause that process to stop or shutdown or a code which detect that a certain process has been start and it should be stopped.
Or can any one give me a good site on IPC to implement the idea above.
Thanks in advance
-oam
|
|
|
|
|
Hi
First of all, call EnumProcess to get all the processes running in the system.
Then call OpenProcess to open the running proccess. You will have got a handle the required Process by now. Set the required access right while opening the process.
Now call TerminateProcess to terminate the process.
Hope this would work for you
Regards
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
I understand the first paragraph of your comment, but i don't understand if the program will send a message to the running process. I wanted something that will communicate with the running process in many ways.
oam
|
|
|
|
|
Hi
Using of shared memory will of any use to you?
Regards
Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hello,
I need to read in all text in a file, How can I do that?.
I need to read in all information direkt.
I have try this;
while(fgets(szLine, 256, filep));
But I only get the first text line.
|
|
|
|
|
Unless I needed to read one line at a time, I would just:
1) Open file for read only.
2) Call _filelength to determine the amount of memory needed.
3) Allocate a buffer large enough to hold it.
4) Call fread, to read the entire text file into the buffer.
5) Close the file.
Now that I have it in a buffer I can do what ever I what with the data.
Thats the simplis way.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
char buffer[HOPEFULLY_BIG_ENOUGH];
int i = 0;
while( !feof(filep))
{
buffer[i] = fgetc(filep);
++i;
}
|
|
|
|
|
Are you kidding? This is the epitome of inefficient. For very small files it would probably suffice, but for files of measureable size, reading from a file one character at a time is a bad design.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Unless you're not using C++, use iostreams instead of C file handling. I have an article on this site about how to do this in C++, I believe.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
And if you are using MFC, try CStdIOFile.
"Aerodynamically, the bumble bee shouldn't be able to fly, but the
bumble bee doesn't know it so it goes on flying anyway." - Mary Kay Ash
My Articles
|
|
|
|
|
Hello,
This may seem rather easy for most of you, but I seem to have difficulty with what should be a very easy task.
I have a Main Frame that opens with a background bmp but no Child. What I want to do is when you click "Start" from the menu, a dialog opens. After filling out a few variables in the dialog, I want to close the dialog, then open two new/different child windows (actually I would like to split the main window into 4 parts and place adifferent child into each quarter).
Can anyone direct me to an online file or tutorial for something like this? I can't seem to find the right reference.
Any help would be GREATLY appreciated!
Thomas (tntnmmd@hotmail.com)
|
|
|
|
|
From the Start Menu ?
Override WM_COMMAND
OnCommand()
{
check ur menu ID, if it from start menu,
CChildDlg oDlg;
oDlg.DoModal();
}
4 Frames???? Sounds like u really need a splitter wnd...
hey refer MSDN , there is no other better source for MFC/SDK..
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
hi,
I would like to know if there is a way by which an application can hook into other applications and access their gui controls (like buttons, textboxes....).
I have done some research on this. I found out that a dll (with SetWindowsHookEx) can be used to hook into the message queue of an application so as to receive all the notifications that are sent to the application. Another method is WH_CBT and CBTProc. But I'm still not clear as to how this can be used to access the internal controls of a windows application.
Thanking you.
|
|
|
|
|
One way would be to send the other application the appropriate message. To "click" a button, try:
SendMessage(hwnd_of_other_app, WM_COMMAND, MAKEWPARAM(button_id, BN_CLICKED), hwnd_of_button);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Thank you for replying. SendMessage could help in simulating button clicks. But my problem is how will i know about the button_id ?
The basic assumption is that my application will not know anything about the internal structure of the target application (except for the fact that it is a windows exe). In that case how can i query the control ids ? Is there some generic way that will help to query the ids of the controls ?
Or should i resort to extracting info from the exe file itself ?
Any help will be appreciated.
|
|
|
|
|
Use FindWindowEx() and/or EnumChildWindows() to find the window/control in question. From there you can use GetDlgCtrlID() to get the identifier of the control.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
How to convert a PLBYTE to integer array?
Thx!
|
|
|
|
|
int* makeIntArrayFromByteArrary(LPBYTE *pByte,size_t cbByte)
{
int* pInt = (int*)malloc(cbByte * sizeof(int));
if( pInt ) {
int i;
for( i=0; i<cbByte; ++i )
pInt[i] = pByte[i];
}
return pInt;
}
int* makeIntArrayFromByteArrary(LPBYTE *pByte,size_t cbByte)
{
int* pInt = new int[cbByte];
if( pInt ) {
for( int i=0; i<cbByte; ++i )
pInt[i] = int(pByte[i]);
}
return pInt;
} Do not forget, you are responsible for freeing memory after you are finished using the allocated arrary of intergers.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Maybe it is really a newbie problem, but how to obtain the size of *pByte? just use sizeof operator?
|
|
|
|