|
mikobi wrote: CFlatComboBox* cana = (CFlatComboBox*) GetDlgItem(IDC_analyse);
cana->ShowDropDown();
|
|
|
|
|
Thanks a lot Sir; Your are right.
ShowDropDown()
I test it; it's work very well.
Thanks all for your help.
|
|
|
|
|
VC ++ 2005
private: System::Void comboBox1_Enter(System::Object^ sender, System::EventArgs^ e) {
comboBox1->DroppedDown=true;
}
|
|
|
|
|
Hey guys,
I was wondering if u can have a user defined type such as:
public enum Pizza { SMALL = 5.99, M = 7.99, L = 9.99 };
I am not quite sure if you can declare double variables inside the Pizza type?
I believe someone can help
|
|
|
|
|
Enum values are always integers.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
nope ; internally, enum s are actually int s
|
|
|
|
|
|
Dear Sir, my problem have not solution up to now.
For example; my button have IDC_Button identifier,
I want that if values on two edit controls are equals, automatically there is a click on my button to confirm the result.
What to do it ?
|
|
|
|
|
I guess the answers you got in your previous thread here[^] didn't help you.
mikobi wrote: automatically there is a click on my button to confirm the result
What do you mean by "automatically"?
You have to write code that verifies that the contents of the two edit controls are the same.
If the ID of your button equals IDC_SHOW , then you could "simulate" a click on the button by sending or posting a WM_COMMAND message to the window that contains the button, like this:
PostMessage( WM_COMMAND, MAKELONG( IDC_SHOW, BN_CLICKED ) );
-- modified at 9:49 Thursday 1st February, 2007
Added code example.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Thanks for your reply, I wanted this code you send me.
I try it, it's work very well.
Thanks a lot
|
|
|
|
|
mikobi wrote: I try it, it's work very well.
That's nice, but why do you think that you cannot simply call the message handler directly like you were suggested by baerten in your previous thread and by David below?
Is it a threading issue, another window or what?
As I understand it you would check the contents of your two edit controls in a call chain originating from EN_CHANGE event handler for the edit controls. The most intuitive solution would be to call the event handler for the BN_CLICKED event of your button.
My point is that it's unnecessary to cross the river in order to fetch water.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
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
|
|
|
|
|