|
I got a error testing funcions Randor made... What can it be?
'SendInput' : redefinition; different basic types
winuser.h(5297) : see declaration of 'SendInput'
I'm coding C
|
|
|
|
|
It means 'SendInput' is already defined. Rename the function to somthing other than SendInput to avoid the conflict.
-David Delaune
|
|
|
|
|
I am wondering why you are suggesting inline assembly to do this as OP already has access to SendInput() API.
|
|
|
|
|
Im not suggesting inline assembly.
I instructed the poster on how to use the SendInput() function and presented several other options. I am simply sharing my knowledge.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi! Everybody,
I am new to programming and this is my first post here. I have problem with assigning a string which is returned by the active component to my edit control box. I will appreciate any hint if possible.
I have created a dialog based MFC standard application and I am using a button to simulate the problem by clicking on the button, but without any progress. This is the description of what I have done:
- Created a C++ dialog based MFC application
- inserted an ActiveX component and created a member variable called “m_Active“
- inserted an edit control and created a member variable called “m_Edit”
- inserted a button and crated a member variable called ”m_Button”
void CTestDlg::OnBnClickedButton()
{
// TODO: Add your control notification handler code here
m_Active.mConnect(0);
m_Active.mListening(1,2000);
m_Active.mStartServers(1,2001,2002,2003);
m_Active.mStreamVideo(1);
m_Active.mStreamAudio(1);
m_Edit.SetString(mGetLocalHostName);
}
……………………………………………………………………………………………………………………
Every thing works fine untill the last line
M_Edit.SetString(mGetLocalHostName);
I have to add that “mGetLocalHostName” forces the ActiveX component to return the string wich I am intending to have in the Edit control.
I hope I have been able to describe the problem I have. And I appriciate any kind of help.
|
|
|
|
|
Hamid intact wrote: inserted an edit control and created a member variable called “m_Edit”
What kind of a member variable is m_Edit? Since you are calling SetString() upon that member variable, I am assuming it is a COleVariant . Try using a control variable instead of it and call SetWindowText(mGetLocalHostName) on it instead.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi Rajesh!
Thank you for showing interest in this problem.
I did the changes you suggested.
“m_Edit” is a control variable member now. And after changing the code to
void CTestDlg::OnBnClickedButton()
{
// TODO: Add your control notification handler code here
m_Active.mConnect(0);
m_Active.mListening(1,2000);
m_Active.mStartServers(1,2001,2002,2003);
m_Active.mStreamVideo(1);
m_Active.mStreamAudio(1);
m_Edit. SetWindowTextW(m_server.mGetLocalHostName);
}
I get an error which says:
error C3867: 'CTestserver::mGetLocalHostName': function call missing argument list; use '&CTestserver::mGetLocalHostName' to create a pointer to member
Could you please lead me to a solution?
With thanks in advance.
|
|
|
|
|
What is a mGetLocalHostName ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi David!
"mGetLocalHostName" returns a string containing the domain name and service of the local socket endpoint.
|
|
|
|
|
Hamid intact wrote: "mGetLocalHostName" returns a string containing the domain name and service of the local socket endpoint.
Then why are you doing like this: m_Edit. SetWindowTextW(m_server.mGetLocalHostName); ? Won't m_Edit.SetWindowTextW(mGetLocalHostName) suffice? Just try m_Edit.SetWindowTextW(_T("Hello world")); . Is that working? If yes, the problem is not with SetWindowTextW .
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi Rajesh!
m_Edit.SetWindowTextW(mGetLocalHostName) end with an error (undeclared identifier)
m_Edit.SetWindowTextW(_T("Hello world")); works fine
I have changed the last line as
m_ip. SetWindowTextW(m_server.mGetLocalHostName());
and I get the returned string from ActiveX component in the Edit kontroll.
It works fine now. Thank you. I could not have been succseded without the help from Krmed and you.
|
|
|
|
|
You're welcome, Hamid. I'm glad I could be of some help.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
It would appear that you are trying to call a method (mGetLocalHostName) in your ActiveX, but are just passing the method name - you're missing the call and arguments.
Perhaps it should be:
m_Edit. SetWindowTextW(m_server.mGetLocalHostName(arguments_go_here if any));
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Hi Krmed!
You are right. I have been missing () för the argument.
m_ip. SetWindowTextW(m_server.mGetLocalHostName());
It works fine now. Thank you. I could not have been succseded without the help from Rajesh and you.
|
|
|
|
|
Hello, i know this will sound kind of a noob question, but i cannot find any support on this anywhere.
I made a project in visual studio c++ (non-managed) and every time I need to change the icons, the executable will get a random icon (i guess it's the first icon i add at the resource editor.)
Is there any way to set the icon i want to the exe file in the editor without those time consuming workarounds?
best regards
|
|
|
|
|
marcio kovags wrote: i guess it's the first icon i add at the resource editor
Correct.
marcio kovags wrote: Is there any way to set the icon i want to the exe file in the editor without those time consuming workarounds?
Time-consuming workarounds? How about just leaving one icon (with an ID of 1)
as the app's icon (used by the system shell) and add any other icons you need to the
resources?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Dear all,
I have,
CImageList ImgList1;
CImageList ImgList2;
CImageList MasterImgList;
I have added several "CBitMap" objects to the "ImgList1" and "ImgList2" using CImageList::Add( CBitmap* pbmImage, COLORREF crMask ) method.
Now I would Like to Merge "ImgList1" and "ImgList2" to the "MasterImgList".
That is after merging, "MasterImgList" contains both the contents of "ImgList1" and ImgList2".
Please help me..
Thanks in Advance
George K Jolly
|
|
|
|
|
georgekjolly wrote: Now I would Like to Merge "ImgList1" and "ImgList2" to the "MasterImgList".
why CImageList:: ( Add, Copy, Remove, Replace) member functions can't be used to achieve the image list merge.
|
|
|
|
|
Try using CImageList::GetImageInfo() to get the HBITMAP handles for
the bitmap and mask of the imagelist you want to add.
With those handles, you can make the CBitmap objects to use in a
call to CImageList::Add().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
Thank you for your reply.
You mean, extracting BitMap from CImageList and adding it to the Master Image List..
But will it make any overhead ?
Or Can we achieve the merging of ImageLists using some other methods like Copy..
Thanks
George K Jolly
|
|
|
|
|
It wouldn't really be "extracting" the bitmaps from the imagelist since
bitmap(s) are part of an image list already. What I described is more of a
copy and add.
Sure there's overhead - there's overhead doing anything. Whether it's
detrimental to the performance of your app or not depends on how often you do it.
e.g. Thousands of times a second...You could do better managing bitmap memory yourself
The most overhead probably involves creating a new bitmap, copying the original bitmap,
then the copy from the second imagelist bitmap. It's still more efficient than adding one
image at a time, which is what imagelists are best suited for (in their available functionality).
I don't know of a copy operation that copies one imagelist to another.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Is anybody knows how to run MS ACCESS from dialog?
Thanks.
|
|
|
|
|
Do you just want to run MS Access or you want to do interact with an MS Access database? Have a look at ShellExecute() API to run MS Access and CDatabase class to interact with a datbase (if you're using MFC).
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thank you. ShellExecute() API to run MS Access is quite enough for me. Now I need to understand how to send password into MS Access with help of ShellExecute().
|
|
|
|
|
It will only work if Access accepts command-line arguments.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|