|
What exactly are you trying to do? You can position your cursor by calling SetCursorPos SetCursorPos[^]
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Didn't think it worked with rich edit
|
|
|
|
|
Hello,
Below codings gives error when I use extern "C" in my dll project.
extern "C" __declspec(dllexport) void Init(); // Gives error
__declspec(dllexport) void Init(); // Can work
extern "C" __declspec(dllexport) void Init();
EXTERN_C const IID DIID__IEventFiringObjectEvents;
template <class T>
class CProxy_IEventFiringObjectEvents : public IConnectionPointImpl<T, &DIID__IEventFiringObjectEvents, CComDynamicUnkArray>
{
extern "C" __declspec(dllexport) void Init()
{
T* pT = static_cast<T*>(this);
};
};
Using extern "C" gives below error message :
error C2059: syntax error : 'string'
Please guide me on how to include extern "C".
Thanking you in advance,
Goutam
|
|
|
|
|
You cannot use extern "C" with classes and templates .
What are you trying to do?
|
|
|
|
|
extern "C" is used to make the function callable from C. Clearly a member function isn't callable from C. Your code doesn't make sense as the two concepts are not compatible.
Steve
|
|
|
|
|
Hello,
Thank you for trying to solve this problem.
I am using samples from "Understanding COM Event Handling" by Lim Bio Liong... URL below :
Understanding COM Event Handling[^]
I am trying to fire event from a ATL dll file, callable from client.
To fire event I need to use class template.
I am using extern "C" before the function name in ATL dll file, to export this function and to make it visible at client.
Below is full code :
__declspec(dllexport) void Init(SMESSAGE* sMessage);
EXTERN_C const IID DIID__IEventFiringObjectEvents;
template <class T>
class CProxy_IEventFiringObjectEvents : public IConnectionPointImpl<T, &DIID__IEventFiringObjectEvents, CComDynamicUnkArray>
{
__declspec(dllexport) void Init(SMESSAGE* sMessage)
{
CComVariant varResult;
VARIANT var;
T* pT = static_cast<T*>(this);
int nConnectionIndex;
int nConnections = m_vec.GetSize();
for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
{
pT->Lock();
CComPtr<IUnknown> sp = m_vec.GetAt(nConnectionIndex);
pT->Unlock();
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(sp.p);
if (pDispatch != NULL)
{
VariantInit(&var);
VariantClear(&var);
V_VT(&var) = VT_RECORD | VT_BYREF;
V_RECORD(&var) = &sMessage;
DISPPARAMS disp = { &var, NULL, 5, 0 };
pDispatch->Invoke(0x4, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
}
}
}
};
Thanking you in advance,
Goutam
|
|
|
|
|
It is true, You cannot use extern "C" with classes and templates.
In the C language, the string-literal "C" is not recognized. It is used in C++ to prevent name decoration.
Remove the string-literal "C" in extern declarations, or use the following in the function declaration:
<pre>#ifdef __cplusplus
extern "C"
#endif
http://support.microsoft.com/kb/133070[^]
|
|
|
|
|
Thank you for all.
I just tested and verified that I can export function even without extern "C" from a dll.
|
|
|
|
|
hi,
how to send data to multiple clients from single server.i can send data to single clients but how to handle multiple client. can any one provide code for that part.
sravanthi
|
|
|
|
|
In main thread you listen for client connections. Once you got a client connection, you can create a corresponding socket and thread.Then all the communication can be handled in that thread using that socket.
Of course, if there are too many client to deal with, this is not a good way. You can use iocp instead.
|
|
|
|
|
i am using data gram socket where listen and accept will not be used.
i want just to handle three to four clients. can u please provide that part of code.
|
|
|
|
|
|
i go with this simple structure
typedef struct sturctEGO {<br />
int ID;<br />
int Superego; <br />
int Ego = Superego - ID; <br />
} Me;
Am i right ?
the theory http://en.wikipedia.org/wiki/Id,_ego,_and_super-ego
|
|
|
|
|
Had you actually tried to compile this before asking the question you would have noticed that the line
int Ego = Superego - ID;
produces a number of errors, as it is an invalid expression. Other than that your structure may or may not have some use.
It's time for a new signature.
|
|
|
|
|
Craps: you're an idiot!
You're simply wrong.
Well, it is pretty good, but you probably can do better.
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]
|
|
|
|
|
It's not for any use...only to help informatics students understand better the structure model of Sigmund Freud the ones that listen psychology class in high school
|
|
|
|
|
phicho wrote: to help informatics students understand better the structure model of Sigmund Freud
I don't think it will help anyone to understand anything.
It's time for a new signature.
|
|
|
|
|
You should have posted this in the Lounge.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi,
Is there a way to know if a window is completely Obscured i.e the window is "not visible" to the user but it is behind another larger application window.
I am trying to do or not do something if the window is completely hidden from the user but not made invisible.
Thanks in advance.
|
|
|
|
|
I'd have thought you would enumerate each window and look at their clipping regions - what I dont know is if you can do this in some 'order' ie from 'front' (of screen) to back or 'depth'
Bizarrely enough, I was just checking out this An HTML5 Remote Desktop - Part I[^] and he starts with some routines that might interest you
[edit]
This may be a better way of getting all HWNDS - you'd still then have to traverse the windows represented, testing for intersections etc
http://www.gettingclever.com/2008/12/list-your-hwnds.html[^]
[/edit]
'g'
modified on Tuesday, May 11, 2010 6:08 PM
|
|
|
|
|
Thanks,
I will have alook, I should have specified that i was looking for a windows event something WM_blahblah.
|
|
|
|
|
|
Yeah, sounds interesting except for the caveat. I need to be make it work for all versions of Windows.
|
|
|
|
|
Hi, dear all,
I am using VB6. I am running a program created years ago. when I open a form, I got the following error:
Line 75: Property OleObjectBlob in dirDDBox could not be set.
Line 75: Cannot load control dirDDBox; license not found.
Line 83: Property OleObjectBlob in dirListBox could not be set.
Line 83: Cannot load control dirListBox; license not found.
Are dirDDBox and dirListBox shipped with VB6? or belong some other control that need register?
After I run VB6Cli.exe utility, still got the same error.
Can anybody help me. Thanks a lot.
|
|
|
|
|
Try asking at the Visual Basic Messageboard[^] instead, this is for C/C++/MFC.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|