|
You don't need to call ScreenToClient() as the point is already in client coordinates when your message handler receives it.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
if I known the CLSID={986A04A31-C417-432F-A4EA-3243D7B681CFF0}
how could I load this component without a file name?
if there is also a filename with the CLSID,such as 'test.dll',
how to load this componet then?
Thank you.
|
|
|
|
|
For a registered COM object the normal way to instantiate it is by using the CLSID via the CoCreateInstance API.
Steve
|
|
|
|
|
CString sguid =_T("{8FA04A31-C417-432F-A4EA-63D7B681CFF0}");
CLSID clsid;
USES_CONVERSION;
if (SUCCEEDED(CLSIDFromString(T2OLE((LPCTSTR)sguid),&clsid)))
AfxMessageBox("We have got CLSID");
CoCreateInstance(clsid,NULL,0,??,NULL);
But,How to set the fourth param? And If I also got the filename,how to use it?
thank you!
|
|
|
|
|
Using ATL I'd use code something like this:
CComPtr<IUnknown> spUnk;
spUnk.CoCreateInstance(clsid);
Note however that it's very strange to create a COM component and not to know which interface you want from it.
Steve
|
|
|
|
|
[General]
;This is the name displayed in Myie2 which indicate your plugin
Name=PowerBand
Author=AWater
Version=1.0
ModuleType=COM
Comments=PowerBand
Type=M2Plugin_SideBar
FileName=PowerBand.dll
CLSID={8FA04A31-C417-432F-A4EA-63D7B681CFF0}
HotIcon=pb.ico
Icon=pb.ico
This is a pluin.ini of PowerBand for myie.
I want to known how to run this plugin in code.
I tried but failed. Could you give me a help?
Much thanks.
Alick
|
|
|
|
|
You say it's a plug-in; a plug-in for what? Generally a plug-in is only useful within a specific context. For example, an IE plug-in is only useful within the context of IE as the plug-in expects certain services from IE and IE expects specific services from the plug-in. To use the plug-in on its own you would have to implement the client side of the relationship. Can you be clearer about what you're trying to achieve?
Steve
|
|
|
|
|
Thank you Steve.
I knew what you mean.
But I found that.There is a msn messenger button on IE toolbar.
And I searched the web that there is only a CLSID for IE to excute msnmsgr.exe.
But how?I have no idea.
Thank you.
Thank you.
Thank you.
|
|
|
|
|
Does anyone have a sample project of saving data and retrieving
it? This sounds like an undergraduate project, but its not
and Im really stumped because there is alot more too it. I currently
am saving and retrieving using basic c commands that I learned
along time ago. I like to know how to use CDocument or see an
example of it.
How can I find an example of a project that saves a project as
say .xyz file and then lets the user retrieve that file.
Please, any response any one can give me will be greatly
appreciated. My email address is brinasas@yahoo.com
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
In windows XP, OnDeviceChange work fine, and when i use it under windows 98, it couldn't work. What should i do to fix this trouble?
|
|
|
|
|
Could someone help me? I just want to detect whether the CD/DVD disk were inserted into the CD-ROM.
|
|
|
|
|
I fixed this problem using another method.
|
|
|
|
|
I know there is a Api can get icon from other application conveniently, but i forget which is it. Or is there any other methods can get icon from other application.
I need to load it and display it in my app.
|
|
|
|
|
ExtractIconEx()
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
wanglei1980 wrote: I know there is a Api can get icon from other application conveniently, but i forget which is it. Or is there any other methods can get icon from other application.
you need ICON as Image or Handle Only.. If Handle ExtractIcon[Ex] will work, if you want Image then you have to use combination of UpdateResource, BeginUpdateResource and <mshelp:link tabindex="0" keywords="_win32_EndUpdateResource_cpp" xmlns:mshelp="http://msdn.microsoft.com/mshelp">EndUpdateResource
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I am using Visual C++ 6.0 MFC on a Windows 2000 box. I want to be able to automate the creation of charts from my C++ application. I can create a chart of x-axis vs y-axis for a single series of data but I can't figure out how to do anything more powerful. My data is output to the spreadsheet as follows... cell A2 is the what should be the series name (device 1) cell B1 is the column header (Line Voltage) and cell C1 is the column header (Current). The current is measured for increasing line voltages and charted. My problems are twofold. How do I get the series name (device 1) to show up in the legend instead of 'series 1'? How do I get multiple series on a single chart? For example, if 5 different devices were tested the 'Line Voltage' (category / x-axis) would be the same for each device but the measured currents would differ. The cells for the 10 measured currents for 'device 1' would be C2 through C11. The cells for the 10 measured currents for 'device 2' would be C15 through C24. The cells for the 10 measured currents for 'device 3' would be C28 through C37 and so on. I have been all over the internet but have only found an example of how to create the simplest of charts. Any link to decent documentation on how to do this would be appreciated.
Thanks
Buck
|
|
|
|
|
Since I usually get a quick response and have not heard anything in 24 hours I'm going to assume that this can't be done.
Buck
Buck
|
|
|
|
|
I am looking for help to display 12 waveforms in one graph. The waveform will have the same horizontal time axias, stacked up as 12 different channels. Such as:
Any code, functions to do this ?
Thanks for any help.
-- modified at 18:55 Monday 5th June, 2006
|
|
|
|
|
Hi all,
I am interested on importing contacts from my msn messenger.
i know how to use the IMessenger2 interface and to loop over the get_MyContacts()....
the problem is that IMessenger2 is the windows messenger (msmgs.exe) and not the msn messenger (msnmsgr.exe).....so on windows 2003 server (which doesn't come by default with windows messenger), importing contacts doesn't work...
can any1 suggest how i can connect to the msn messenger and not to the windows messenger?
any exposed interface?
thanks in advanced
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
YaronNir wrote: the problem is that IMessenger2 is the windows messenger (msmgs.exe) and not the msn messenger (msnmsgr.exe).....so on windows 2003 server (which doesn't come by default with windows messenger), importing contacts doesn't work...
Around a year back i have created a program using automation of MSN Messenger, in My scenario if the MSN Messenger is installed on my computer IMesenger2 work for MSN otherwise good old WindowMessnger, but here situation seems to vice versa
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
How can I get GDI+ stuff to compile in VS 2005?
I started new WIN32 application project with wizard and only added #include <gdiplus.h> and started build. I get a lot of errors. Probably has todo with the " Breaking Changes in the Visual C++ 2005 Compiler " .
I tried to switch of warnings and lot of other things I forgot.
Is there a simple way to get it going?
Van Courten
|
|
|
|
|
There are a lot of examples of GDI+ in MSDN Visual Studio 2005. Try looking there.
Here's an example i took,
#define UNICODE<br />
#include <windows.h><br />
#include <gdiplus.h><br />
using namespace Gdiplus;<br />
<br />
VOID OnPaint(HDC hdc)<br />
{<br />
Graphics graphics(hdc);<br />
Pen pen(Color(255, 0, 0, 255));<br />
graphics.DrawLine(&pen, 0, 0, 200, 100);<br />
}<br />
<br />
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);<br />
<br />
INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, INT iCmdShow)<br />
{<br />
HWND hWnd;<br />
MSG msg;<br />
WNDCLASS wndClass;<br />
GdiplusStartupInput gdiplusStartupInput;<br />
ULONG_PTR gdiplusToken;<br />
<br />
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);<br />
<br />
wndClass.style = CS_HREDRAW | CS_VREDRAW;<br />
wndClass.lpfnWndProc = WndProc;<br />
wndClass.cbClsExtra = 0;<br />
wndClass.cbWndExtra = 0;<br />
wndClass.hInstance = hInstance;<br />
wndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);<br />
wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);<br />
wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);<br />
wndClass.lpszMenuName = NULL;<br />
wndClass.lpszClassName = TEXT("GettingStarted");<br />
<br />
RegisterClass(&wndClass);<br />
<br />
hWnd = CreateWindow(<br />
TEXT("GettingStarted"),
TEXT("Getting Started"),
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
CW_USEDEFAULT,
NULL,
NULL,
hInstance,
NULL);
<br />
ShowWindow(hWnd, iCmdShow);<br />
UpdateWindow(hWnd);<br />
<br />
while(GetMessage(&msg, NULL, 0, 0))<br />
{<br />
TranslateMessage(&msg);<br />
DispatchMessage(&msg);<br />
}<br />
<br />
GdiplusShutdown(gdiplusToken);<br />
return msg.wParam;<br />
}
<br />
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, <br />
WPARAM wParam, LPARAM lParam)<br />
{<br />
HDC hdc;<br />
PAINTSTRUCT ps;<br />
<br />
switch(message)<br />
{<br />
case WM_PAINT:<br />
hdc = BeginPaint(hWnd, &ps);<br />
OnPaint(hdc);<br />
EndPaint(hWnd, &ps);<br />
return 0;<br />
case WM_DESTROY:<br />
PostQuitMessage(0);<br />
return 0;<br />
default:<br />
return DefWindowProc(hWnd, message, wParam, lParam);<br />
}<br />
}
|
|
|
|
|
Yeah, I found a similar example too.
But it won't compile.
So I only put in the "include <gdiplus.h>" line and comiled my "test.cpp" (based on win32 template), at least it should compile (apart from being usefull or not, in the end). And no, it won't compile with my version of VS 2005.
The first errors I get:
Error 1 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\program files\microsoft visual studio 8\vc\platformsdk\include\gdiplusimaging.h 67
Error 2 error C2440: 'initializing' : cannot convert from 'const char [37]' to 'int' e:\program files\microsoft visual studio 8\vc\platformsdk\include\gdiplusimaging.h 67
Error 3 error C2146: syntax error : missing ';' before identifier 'IImageBytes' e:\program files\microsoft visual studio 8\vc\platformsdk\include\gdiplusimaging.h 67
Error 4 error C2470: 'IImageBytes' : looks like a function definition, but there is no parameter list; skipping apparent body e:\program files\microsoft visual studio 8\vc\platformsdk\include\gdiplusimaging.h 67
Error 5 error C2059: syntax error : 'public' e:\program files\microsoft visual studio 8\vc\platformsdk\include\gdiplusimaging.h 67
Error 6 error C2146: syntax error : missing ';' before identifier 'id' e:\program files\microsoft visual studio 8\vc\platformsdk\include\gdiplusimaging.h 246
Error 7 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\program files\microsoft visual studio 8\vc\platformsdk\include\gdiplusimaging.h 246
Error 8 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int e:\program files\microsoft visual studio 8\vc\platformsdk\include\gdiplusimaging.h 246
Van Courten
|
|
|
|
|
Can someone please answer the below questions?
Thanks in advance!:
=====
1. How do you ensure data consistency with mulitple threads.
2. How do you implement a single linked with multiple threads accessing and updating the same. What are the different ways to do it. What is best for performance?
3. Write code for inserting into singly linked list, taking into consideration that multiple threads can call the same function concurrently.
=======
1. Implement Singleton design pattern.
2. Update the above code keeping in mind the multiple threads can use this class.
3. And change the solution such a way that we get best performance.
4. Discuss algorithm and write code for reversing the words in a string.
5. Come up with an algorithm for the above problem such a way that we don't use extra space.
============
1. If there is a string with only characters 'a' & 'b' in it and given a decode pattern as below
aaa - 1
aba - 2
bbb - 3
Create a new string from the input string and above pattern in which all the instances of pattern above would be replaced with the appropriate decode value in the new string. For example, if the input string is aaaababbbaa the output would be 123aa.
2. Networking questions. Difference between TCP, UDP and why should one use UDP.
3. What is multicast.
4. How does data send and receive work in UDP. How much data can application send at one shot with UDP and how does it work with TCP?
|
|
|
|
|