|
Dear Sir,
Thanks for your interesting to my idea.
I am in the same formView and in Edit change of my edit control I want to send a Clic on my button.
In previous reply, I did n't have exactly the code to write, but in your reply it's very clear for me.
If you found the next reply good for you can explain me clearly with clear codes.
Thanks
|
|
|
|
|
You can use of call message handler of button.
|
|
|
|
|
mikobi wrote:
I want that if values on two edit controls are equals, automatically there is a click on my button to confirm the result.
Why don't you just call the same function that your button-click handler would call?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All
I am making one console application.
I am using getche() function to retrieve a character from console input buffer.
Now I am getting unhandled exception when I run the code.
I am aslo using standard handle for input and output for some other requirement.
I am wondering if these handles are causing problem.
I have removed these handle part from my code.
But still my console application is giving me the same problem.
I viewed call stack , it is showing me some "lock" problem.
So I restarted my computer but it has solved my problem only once.
Now i am again getting the same problem after restarting the computer.
Can anyone help in theis !!!!!!!!!!!
|
|
|
|
|
sachin ahuja wrote: I am using getche() function to retrieve a character from console input buffer.
Now I am getting unhandled exception when I run the code.
Just show the part of the code with the getch() and the exception.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
int main(int argc, char* argv[])
{
//char szGetString[500];
string sData;
int Error;
int i = 0, j = 0;
COORD origin={0,0};
char sIniPath[100];
//DWORD NoOfCharRead;
int ch = getche();
//Initializing the application
if(SUCCESS != (Error = Initialize()))
printf("Error in initilaizing the application\n");
/* hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
if(INVALID_HANDLE_VALUE == hStdOut)
Error = ERR_HT_HANDLE;
GetConsoleScreenBufferInfo(hStdOut , &ConsoleScreenBufferInfoOutPut);
//Setting color for stdout
ConsoleScreenBufferInfoOutPut.wAttributes = FOREGROUND_GREEN;
SetConsoleTextAttribute(hStdOut ,ConsoleScreenBufferInfoOutPut.wAttributes);
//Setting color for stderr
/ *hStdErr = GetStdHandle(STD_ERROR_HANDLE);
if(INVALID_HANDLE_VALUE == hStdErr)
Error = ERR_HT_HANDLE;
GetConsoleScreenBufferInfo(hStdErr , &ConsoleScreenBufferInfo);
ConsoleScreenBufferInfo.wAttributes = FOREGROUND_RED;
SetConsoleTextAttribute(hStdErr ,ConsoleScreenBufferInfo.wAttributes); */
//Getting handle for input buffer
/* hStdIn = GetStdHandle(STD_INPUT_HANDLE);
if(INVALID_HANDLE_VALUE == hStdIn)
Error = ERR_HT_HANDLE;
*/
}
and the exception is
Unhandled exception in XXX.exe:0xC000005:Access violation
|
|
|
|
|
edit your message and use <pre></pre> tags around your code.
and try to use your debugger to figure where the code fails exactly...
|
|
|
|
|
sachin ahuja wrote: A lot of code
Ok, where is the exception coming up?
Certainly not in the piece of code you showed. Most of it is commented out and the other part is not compiling because Initialize() is missing.
So, please use the debugger to find out which line is crashing and prepare a running, minimal program demonstrating the error.
And, as toxcct said, put your code in the pre - tags by marking it and then clicking on "pre". On your screen just above the line with the smilies.
I turned your code into a working mini-application:
#include <windows.h>
#include <conio.h>
#include <string>
int main(int argc, char* argv[])
{
std::string sData;
int Error;
int i = 0, j = 0;
COORD origin={0,0};
char sIniPath[100];
const int ERR_HT_HANDLE = -1;
CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo;
int ch = ::getche();
HANDLE hStdOut = ::GetStdHandle( STD_OUTPUT_HANDLE);
if(INVALID_HANDLE_VALUE == hStdOut) {
Error = ERR_HT_HANDLE;
}
GetConsoleScreenBufferInfo(hStdOut , &ConsoleScreenBufferInfo);
ConsoleScreenBufferInfo.wAttributes = FOREGROUND_GREEN;
SetConsoleTextAttribute(hStdOut ,ConsoleScreenBufferInfo.wAttributes);
HANDLE hStdErr = GetStdHandle( STD_ERROR_HANDLE);
if(INVALID_HANDLE_VALUE == hStdErr) {
Error = ERR_HT_HANDLE;
}
GetConsoleScreenBufferInfo(hStdErr , &ConsoleScreenBufferInfo);
ConsoleScreenBufferInfo.wAttributes = FOREGROUND_RED;
SetConsoleTextAttribute(hStdErr ,ConsoleScreenBufferInfo.wAttributes);
HANDLE hStdIn = GetStdHandle(STD_INPUT_HANDLE);
if(INVALID_HANDLE_VALUE == hStdIn) {
Error = ERR_HT_HANDLE;
}
}
-- modified at 4:01 Friday 2nd February, 2007
!"§$%& include s missing
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
my code is giving problem before initialze function is called.
it is giving me problem on 10th line number ( int ch = ::getche();).
The code crashes here only.
I have seen the call stack which is given below
NTDLL! 77f69ecd()
NTDLL! 77f5b2e6()
_lock(int) line 228 + 7 bytes ********The problem is basically here.
_getche() line 254 + 7 bytes
main(int, char * *) line 56 + 5 bytes
mainCRTStartup() line 206 + 25 bytes
KERNEL32! 77e735dd()
After debugging the application I came to know that there is some problem related to multi threaded.
I have checked all my project settings but all entries are for single threaded wherever required.
Please see initialize() function if it is required
int Initialize()
{
//File Opening
int Error = SUCCESS;
fp = fopen("C:\\log.txt","w");
if(fp == NULL)
{
Error = FAILURE;
printf("Error in opening file\n");
}
return Error;
}
But the code is not reaching here.
I am getting problem before this function.
Kindly see if the problem can be solved.
Thanks in advance.
|
|
|
|
|
Even that can not be, as fp, your result of fopen() , would be undeclared.
Are you using fclose() ?
But first and foremost:
When the first statement in your app crashes, there is something very rotten.
Are you doing some funny linking?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Yeah I am able to solve this issue.
Actually I am linking two libraries in this project which are multi threaded.
And my application(console) was single threaded.
So i have made my application(console) also multithreaded.
Now it is working fine.
Thanks a lot for your kind support and time.
|
|
|
|
|
sachin ahuja wrote: So i have made my application(console) also multithreaded.
Now it is working fine.
Great!;)
And thank you for giving feedback.
Multi/singlethreaded linking usually shows characteristic (but misleading) linker errors. But this...
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Hi
ALL
I am creating unicode DLL i build it then i got zero errors but warning LNK4086: entrypoint "_wWinMainCRTStartup" is not __stdcall with 12 bytes of arguments;"
Atul
|
|
|
|
|
|
How to write the code if want the program run every time while boot windows.
|
|
|
|
|
|
It will need to be a service.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Please advise me the good article or link to learn it.
|
|
|
|
|
|
|
then it's time to use the "I Feel Lucky" Button
|
|
|
|
|
toxcct wrote: then it's time to use the "I Feel Lucky" Button
Is that the one on my keyboard with the little Windows logo that says "start"?
|
|
|
|
|
nope. Open a google start page. what buttons do you see under the search field ?
|
|
|
|
|
It has two buttons but I always see to Lucky
|
|
|
|
|
I forgot all about that one!! I use the Google bar nearly 100% of the time
|
|
|
|