|
Ok, i figured it out.
But now I have another messup. All my keys are in a combo box. I want to get the selected text, or the key. Please help me to do this.
ComboBox_GetText doesn't make sense sir.
Please help me.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
By using CComboBox::GetCurSel you can get the index of the selected item and then use CComboBox::GetLBText()
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Actually I use standard C controls. I only know the ID of it.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
See the messages that you can use with a combo box control then. For instance, CB_GETCURSEL[^] instead of CComboBox::GetCursel().
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi forum!
I'm wondering how could I read the word behind the mouse pointer. Let's say my app. has a CRichEditView and when user stops moving the mouse I want to grab the word that is under the pointer, so I can show a tooltip with certain info. Yes in a fashion like Visual Studio displays a variable value when you mouse over it in debugging mode.
After googling for a couple of days I've just found some approaches like using IAccessible class from MS Active Accesibility:
http://blogs.msdn.com/oldnewthing/archive/2004/04/23/118893.aspx
But it just gives the whole content of the view. And I guess it's not trivial to get the mouse coordinates and translate it into a document position.
Any clues, code samples, references or even claps in the shoulder will be much appreciated.
Thanks in advance
|
|
|
|
|
|
Thanks Stephen! It's just the idea I'm working on now, and it seems to be taking me somewhere... after two days wandering around silly approaches.
Just a couple tips for possible readers:
If like me you're playing with OnMouseMove and a CEdit control, remember that
a) It's the control itself not the containing window wich may handle the WM_MOUSEMOVE message (a couple hours lost for a newbie like me). One way to achieve it is to derive your class from CEdit, place the message handler there and bind your ICD_MY_EDIT_THING with a control variable of this class (DDX stuff).
b) Of course it's the control who has to SendMessage(EM_CHARFORMPOS, ...), so do it in the above mentioned message handler.
c) Watch out the difference of SendMessage LPARAM parameter deppending on you're working with a CEdit or a CRichEditCtrl.
Hope this saves others time and frustration
|
|
|
|
|
hello friends
What points should b consider when i update my project from vs2002 to vs2005.B;coz i m facing too many linker errors like
error LNK2001: unresolved external symbol __imp___CrtDbgReportW
error LNK2001: unresolved external symbol __imp___CrtDbgReportW
error LNK2019: unresolved external symbol "private: class ReferenceMaker & __thiscall ReferenceMaker::operator=(class ReferenceMaker const &)" (??4ReferenceMaker@@AAEAAV0@ABV0@@Z) referenced in function "public: class ReferenceTarget & __thiscall ReferenceTarget::operator=(class ReferenceTarget const &)" (??4ReferenceTarget@@QAEAAV0@ABV0@@Z)
|
|
|
|
|
You may need to locate the appropriate CRT library and include it in your linker settings under Project->(Project Name) Properties.... and also the other libraries if any.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
I added the same library that was in vc 2002. Do i need to add any other except that?
|
|
|
|
|
yogeshs wrote: error LNK2001: unresolved external symbol __imp___CrtDbgReportW
error LNK2001: unresolved external symbol __imp___CrtDbgReportW
Are you linking with libcd.lib or msvcrtd.lib?
"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
|
|
|
|
|
Hi there.
I have an Console based Exe (ABC.exe) that takes some parameters.
Now, I want to call this Exe from some other application and want to pass the paremeters as required.
Problems:
1. I am calling this exe as below
HINSTANCE hInst = ::ShellExecute(NULL, L"open", L"C:\\Documents and Settings\\pankaj.bhalla\\Desktop\\ABC.exe", L"Hello", NULL, SW_SHOW);
ABC.exe application got launched but text "Hello" never got displayed on the console.
2. In place of this hardcoded text i.e., "Hello", incase I want to send some text stored in CString type variable then how can I do that.
Help will be really appretiated.
Thanks
PanB
|
|
|
|
|
PankajB wrote: ABC.exe application got launched but text "Hello" never got displayed on the console.
What is the target application doing with the parameters passed on to it? Is there any code for displaying it or not?
PankajB wrote: 2. In place of this hardcoded text i.e., "Hello", incase I want to send some text stored in CString type variable then how can I do that.
You can pass the CString variable as the fourth parameter as it is, because ShellExecute is expecting an LPCTSTR there and CString will be automatically casted there.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I am basically passing a path to a file.
Target application just check whether file exists, if does not then create that file.
|
|
|
|
|
PankajB wrote: Target application just check whether file exists, if does not then create that file.
You can as well create the file from the calling application as well. Why are you needing to have an executable solely for this? Or is there anything else? If the file copying takes too long and that leaves you with a frozen UI, just spawn a thread. Can't you?
You haven't answered my question: Is the target application handling the command line passed on to it? Without that being done, how will it display the command line?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
PankajB wrote: ABC.exe application got launched but text "Hello" never got displayed on the console.
Why would it be displayed on the console ? Are you retrieving it in the code of your application and prining the argument ? If yes, it's the argument at index 1, and not 0 that you have to use (the first argument is always the path to your application).
PankajB wrote: In place of this hardcoded text i.e., "Hello", incase I want to send some text stored in CString type variable then how can I do that.
Just pass the CString object.
|
|
|
|
|
Does your ABC.exe application correctly print it's first argument if launched by command line?
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]
|
|
|
|
|
Let me provide few details...
1. Lets say ABC.exe just cout the text provided as an argument.
2. If I launch ABC.exe from console, >ABC.exe Hello, it prints out Hello on the Screen.
3. if I call the same application like
HINSTANCE hInst = ::ShellExecute(NULL, L"open", L"C:\\Documents and Settings\\pankaj.bhalla\\Desktop\\ABC.exe", L"Hello", NULL, SW_SHOW);
...it does not
Just FYI, ABC.exe is a Console based Application
|
|
|
|
|
Is the calling application also a console app? If not, does it open a new console window?
|
|
|
|
|
You must show us the target application's code, where you've handled the command line passed on to it.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
HINSTANCE hInst = ::ShellExecute(NULL, L"open", L"C:\\Documents and Settings\\carlo.pallini\\ABC.exe", L"Hello", NULL, SW_SHOW);
works fine with my ABC.exe app...
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]
|
|
|
|
|
CPallini wrote: works fine with my ABC.exe app...
You must have the final release. I tried it with Beta 3 of abc.exe and the output was "Get lost" instead of "Hello"...
|
|
|
|
|
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]
|
|
|
|
|
PankajB wrote: ABC.exe application got launched but text "Hello" never got displayed on the console.
Does the console window open at all?
"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
|
|
|
|
|
Recently I found a code-snippet in C++ on wikipedia. It's used to work with CUDA:
http://en.wikipedia.org/wiki/CUDA[^]
In the last line of
dim3 blockDim(16, 16, 1);
dim3 gridDim(width / blockDim.x, height / blockDim.y, 1);
kernel<<< gridDim, blockDim, 0 >>>(d_odata, width, height);
they are using these operators (or whatever) with "kernel" being a function:
__global__ void kernel(float* odata, int height, int width)
{
unsigned int x = blockIdx.x*blockDim.x + threadIdx.x;
unsigned int y = blockIdx.y*blockDim.y + threadIdx.y;
float c = texfetch(tex, x, y);
odata[y*width+x] = c;
}
What's the purpose for <<< and >>>? Thx for your answer!
|
|
|
|