|
Dear Rajesh,
If i really know why should i post this message. I have really Struk with this. If you have any Idea please Help me Out. I am in deep trouble. I want to know this Concept. Please Help Me Out with proper Solution.
Thanks & Regards,
Uday.
|
|
|
|
|
janaswamy uday wrote: If i really know why should i post this message. I have really Struk with this. If you have any Idea please Help me Out. I am in deep trouble. I want to know this Concept. Please Help Me Out with proper Solution.
I'm sorry to know that you're in deep trouble.
The said function returns a value that you should check. If the function fails, the return value actually tells why did it fail so. Take a look at the "diagnostics" section of the documentation page to know more.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
I use Win32 Dynamic-Link Library and I would like to create a member that can show something like a MessageBox with OK button (Exit), it also shows a message (ie: "Please enter your comments in the User Input") and a TextBox input.
After the user entering his/her comments then hits OK button, it will return the user input!
Do we have any thing available like that? If not, might anyone help me on this?
Thanks in-advanced
|
|
|
|
|
THAQCD wrote: Do we have any thing available like that? If not, might anyone help me on this?
Yes it's called a Dialog Box[^] (CDialog if MFC).
|
|
|
|
|
Hi Richard,
I am trying to get any codes related to your link (only information) & others in order to create a Dialog box from my Win32 Dynamic-Link Library project ... but couldn't find any thing yet!
Any suggestion?
Thanks for help
|
|
|
|
|
The link he gave you was a good one. The fact you're asking a basic question (nothing wrong with being at the start of something) means you have a lot of learning to do. The link he gave you is Microsoft's explanation of the concepts.
There are many links throughout that article pointing to more specific things.
As for an actual function?
Try: DialogBox, or CreateDialog.
You'll also need a Dialog resource. And if you're in pure Win32, you'll have to learn about instance handles.
(All of this is googlable - I'm trying to give you search terms)
If you're starting from nothing, then this is not easy stuff. Don't expect to solve it in 10 minutes.
Also, you cannot expect someone here to write "codez" for you that will do exactly what you want. What he was trying to do was to steer you at learning material so you can do it yourself - or at least start to, and ask more detailed questions later.
Good luck,
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Thank for the advice, actually I am trying to learn how to do it now and you are right so far I have spent more than 1 hour to try
|
|
|
|
|
Only an hour?
You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
|
Hi, i am new to Visual C++ and facing problem with combo boxes.
Here is what i need:
Combobox1
Choice: Metal, Plastic
Combobox2
Choice: if Metal in Combobox1: 2,3,4,5,6
Choice: if Plastic in Combobox1: 8,10,15
I am unable to write code for the event, can any one help me out with the hints or links or code!...any help is highly appreciated...!
#pragma once
namespace PR {
using namespace System; using namespace System::ComponentModel; using namespace System::Collections;
using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing;
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{ InitializeComponent();
}
protected:
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::ComboBox^ comboBox1;
protected:
private: System::Windows::Forms::ComboBox^ comboBox2;
private:
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
void InitializeComponent(void)
{
this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
this->comboBox2 = (gcnew System::Windows::Forms::ComboBox());
this->SuspendLayout();
this->comboBox1->FormattingEnabled = true;
this->comboBox1->Items->AddRange(gcnew cli::array< System::Object^ >(2) {L"METAL", L"PLASTIC"});
this->comboBox1->Location = System::Drawing::Point(81, 80);
this->comboBox1->Name = L"comboBox1";
this->comboBox1->Size = System::Drawing::Size(121, 21);
this->comboBox1->TabIndex = 0;
this->comboBox1->Text = L"METAL";
this->comboBox2->FormattingEnabled = true;
this->comboBox2->Items->AddRange(gcnew cli::array< System::Object^ >(5) {L"2", L"3", L"4", L"5", L"6"});
this->comboBox2->Location = System::Drawing::Point(81, 126);
this->comboBox2->Name = L"comboBox2";
this->comboBox2->Size = System::Drawing::Size(121, 21);
this->comboBox2->TabIndex = 1;
this->comboBox2->Text = L"2";
this->comboBox2->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::comboBox2_SelectedIndexChanged);
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(292, 266);
this->Controls->Add(this->comboBox2);
this->Controls->Add(this->comboBox1);
this->Name = L"Form1";
this->Text = L"Form1";
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void comboBox2_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {
}
};
}
modified on Monday, October 19, 2009 10:27 AM
|
|
|
|
|
you'd probably need to post this in the "Managed c++/cli" forum.
anyway, there's stuff missing from you post.
This signature was proudly tested on animals.
|
|
|
|
|
Hi Maximilien
Please find the complete code now, or should i post it on "Managed C++/CLI" forum?
Any help is appreciated. Thanks
|
|
|
|
|
Invinci wrote: should i post it on "Managed C++/CLI" forum?
yes.
This signature was proudly tested on animals.
|
|
|
|
|
My MFC applicatin crashes with this call stack info.
Can anyone please help me out in understanding this?
ntdll!KiUserExceptionDispatcher+e
<Unloaded_RapidEyeAPI.dll> +1e701
ntdll!ExecuteHandler2+26
ntdll!ExecuteHandler+24
ntdll!KiUserExceptionDispatcher+e
<Unloaded_RapidEyeAPI.dll> +1e701
ntdll!ExecuteHandler2+26
ntdll!ExecuteHandler+24
ntdll!KiUserExceptionDispatcher+e
<Unloaded_RapidEyeAPI.dll> +1e701
ntdll!ExecuteHandler2+26
ntdll!ExecuteHandler+24
ntdll!KiUserExceptionDispatcher+e
<Unloaded_RapidEyeAPI.dll> +1e701
ntdll!ExecuteHandler2+26
ntdll!ExecuteHandler+24
ntdll!KiUserExceptionDispatcher+e
<Unloaded_RapidEyeAPI.dll>+271d
ntdll!RtlpAllocateFromHeapLookaside+42
<Unloaded_RapidEyeAPI.dll>+39f3
ntdll!RtlpAllocateFromHeapLookaside+42
<Unloaded_RapidEyeAPI.dll>+1c999
ntdll!RtlpAllocateFromHeapLookaside+42
kernel32!BaseThreadStart+37
modified on Monday, October 19, 2009 9:13 AM
|
|
|
|
|
Could you solve your problem?
BaseThreadStart is indicating that you are creating a new thread?
|
|
|
|
|
Hi all,
I have written a program which can monitor a specific program when it was closed.I used hook to do it and everything seem be ok but the problem is that I cannot hook WM_CLOSE message.
I have tried to use WH_GETMESSAGE, WH_CBT, WH_CALLWNDPROC. But all of them seem not work properly!
here is my code:
hHook = SetWindowsHookEx(WH_CALLWNDPROC,fnHookProc,hInstDLL,tid);
DLLEXPORT LRESULT CALLBACK KeyboardProc(int nCode,WPARAM wParam, LPARAM lParam)
{
LPMSG msg = (LPMSG)lParam;
if(msg->message == WM_CLOSE )
{
}
return CallNextHookEx(_hHook,nCode,wParam, lParam);
}
anybody help me.
thanks
[N][Q][H]
|
|
|
|
|
There must be something special about the WM_CLOSE message. Are you using a DLL? Are you calling SetWindowLong() in that DLL? Are you injecting the DLL into the process of the "specific window?"
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Because this is a global hook which will monitor all message before they really reach to target window. So I think It doesn't need inject the dll to the target window. But I will try.
I took a round from google and know that many people have the same problem with me when they try to catch the WM_CLOSE. But I still cannot find the solution.
[N][Q][H]
|
|
|
|
|
[N][Q][H] wrote: DLLEXPORT LRESULT CALLBACK KeyboardProc(int nCode,WPARAM wParam, LPARAM lParam)
You hook handler seems to be incorrect. For instance if you are using the WH_CALLWNDPROC, the handler should be like
LRESULT CALLBACK CallWndProc(int nCode,WPARAM wParam, LPARAM lParam)
{
PCWPSTRUCT msg = (PCWPSTRUCT)lParam;
if(msg->message == WM_CLOSE )
{
}
return CallNextHookEx(_hHook,nCode,wParam, lParam);
}
|
|
|
|
|
ok, KeyboardProc must be renamed to fnHookProc. But this is not the cause. This just a mistake when I copy from my code.
LRESULT CALLBACK LRESULT CALLBACK fnHookProc(int nCode,WPARAM wParam, LPARAM lParam)
{
PCWPSTRUCT msg = (PCWPSTRUCT)lParam;
if(msg->message == WM_CLOSE )
{
}
return CallNextHookEx(_hHook,nCode,wParam, lParam);
}
[N][Q][H]
|
|
|
|
|
It's an old Win32 FAQ (see onWin32 grp[^]) (same method than on Win 9x)
|
|
|
|
|
Dear all,
I am using MFC dialog application to get an text input from the user and make processing on it and then reply with response but I need to declare some variables to be working throughout the whole system cycle(I think its called global variables) to be accessible whereever from my system coding files. Because I need to deal with the variable changes during the system cycle.
I tired many things Like: static ,extern. But till now I'm beginner in this language so I didn't know how to deal with them in .cpp files.
Please any help will be appreciated.
Best regards.
|
|
|
|
|
If you need a global variable in your application, then you have an example at hand: the variable theApp (have look at it in your application). You may use the same route for your own global variable: declare it as extern in the main header of your application (the one included by all the - or the relevant - sources and define it in the main source. For instance, suppose your application name is test , then in test.h :
extern int g_iMainCounter;
and in test.cpp
int g_iMainCounter;
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thank you for your reply and its work fine only when I want to use the variable in test.cpp. and in testDlg.cpp because you know I'm using dialog application.
But I tried to use the same variable in different files inside the same application for example in XX.cpp its already undeclared identifier there and I tried to include the header file #include "XX.h" and I can't access this variable.
Please help me.
And thanks alot again.
|
|
|
|
|
You need to include "test.h".
|
|
|
|