|
I already answered this one for him under "Need help with code" in this forum (Nov 8). Guess he doesn't read very well.
Dave.
|
|
|
|
|
Maybe he has the Memento [^] syndrome.
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]
|
|
|
|
|
I have a problem regarding DLLs.
We can load a DLL dynamically by using Load Library() function and then we can access the functions of DLL by using GetProcAddress().
But how to Import a class from DLL.
Here actually i want to import a class in my application from a DLL called nnotes.dll ( its a lotus notes DLL). I can see the classes exist in that DLL thru dependency walker. But i don't no the way to achieve it.
Please any body solve my problem...
|
|
|
|
|
|
Hi Hamid,
Thanks for your reply. But still i have problem.
In the exaple what you told, we are the one who created DLLs.
But i need to access classes from a DLL which is not built by me.
basically requirement is am building an application for lotus notes
which is used to work mail level. the minimum requirement for my
application to run is few lotus DLL. If i link these DLLs statically i can
do whatever i want But i want to know the dynamic linking for this.
can you help me in that way.
And really thanks for your response. Because of that i came to know about how
to export/import classes from DLLs which we are going to create.
Thanking you.
Umesh Pai K.K
|
|
|
|
|
Hamid has pointed you to a good article - but it doesn't deal with "run time linking" of objects.
This is not a trivial subject, and is a significant part of the reason COM was invented.
In my software, I go a COM-similar way. I have a base class in a H file, with all-pure-virtual methods. I also have a "get me an object of CXXXX type please" C exportable function exported by the DLL. Inside the DLL I have a CImplementXXXX class that I create an instance of and return.
All very COM/CoCreateInstance. All I'm missing is GUIDs.
As to your problem...
Can you solve it by brute force? Writing a second DLL that compile time links to this class (using the approach in the article), and provides a mechannism like I describe above to create an interface to a proxy object within your DLL?
I'm running out of steam, so I'll wish you well.
Iain.
|
|
|
|
|
An example of the Iain's COM -like technique here [^].
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]
|
|
|
|
|
I'm now a The? Oooo.
It's a good article you point to - though I think the hack to allow you to access the member functions is a bit too hard and prone to dumb coder mistakes (like I regularly make) for my liking!
It may help him in his reuse of a DLL I bet he has no code access to...
Iain.
|
|
|
|
|
Can someone explain to me how to make a remainder equal the equation for remainder using x and y.
|
|
|
|
|
Sounds like you're after the modulus operator. - %
Code
int x=10, y=7;
printf("x/y = %d, remainder %d\n", x/y, x%y);
Output
x/y = 1, remainder 3
|
|
|
|
|
I have a problem with getting message WM_INPUT for rawinput in MFC. There is no such problem in Win32.
Here is my code.....
My message map:
BEGIN_MESSAGE_MAP(CCEREC_MCDlg, CDialog)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_INPUT, GetRawData)
END_MESSAGE_MAP()
In header:
afx_msg LRESULT GetRawData(WPARAM wParam, LPARAM lParam);
Register raw device:
BOOL CCEREC_MCDlg::InitRawDevices(void)
{
Rid.usUsagePage = 0x01;
Rid.usUsage = 0x06; //for keyboard;
Rid.dwFlags = 0;
Rid.hwndTarget = 0;
if (RegisterRawInputDevices(&Rid, 1, sizeof(Rid)) == FALSE)
return false;
else
return true;
}
Function:
LRESULT CCEREC_MCDlg::GetRawData(WPARAM wParam, LPARAM lParam)
{
return 0;
}
|
|
|
|
|
And what is the problem?
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]
|
|
|
|
|
When I press buttons WN_INPUT is not generated. I also tried with mouse and gamepad.
When I use Win32 all work perfectly but I need solution for MFC.
|
|
|
|
|
APahuchiy wrote: Rid.hwndTarget = 0;
How does the system know to send the message to your dialog?
Shouldn't you specify the dialog's HWND there?
I bet the control with focus is receiving the message fine
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
From MSDN
hwndTarget
Handle to the target window. If NULL it follows the keyboard focus.
No Mark, It doesn't work whether or not dialog in focus.
|
|
|
|
|
Right.
You're handling the message in the dialog, which
doesn't get keyboard focus.
Maybe use the dialog window's HWND...
Call the CCEREC_MCDlg::InitRawDevices function from OnInitDialog
(it won't work called from the constructor - you need a valid HWND!).
Then use:
Rid.hwndTarget = *this;
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Many Thanks Mark,
It works fine now!
|
|
|
|
|
Cool!
You're welcome!
Thanks for the update,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark,
Thanks for the tips on setting hwnd ... I have searched almost an hour to find this anwer ...
|
|
|
|
|
|
Hi !
I would like to create a simple application with C++ Builder which can play an SWF or WMV file (looping) full screen like dynamic desktop.
My problem in which I would like to ask your help :
- How can I set a Form1 to Desktop level ? I mean, how can I set the application form to stay like desktop the very most back of all other windows as well as desktop icons visible, etc ?
I already tried SenToBack() and ZORder(0) but none of the push the application below desktop icons.
Many thanks for your time and help,
Moore
|
|
|
|
|
You can't push the application behind the desktop icons but in front of the actual desktop because the desktop icons and desktop form one window.
If you have Vista, have you tried DreamScene? I believe it has the ability to play WMV files.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
Well, it is not entirely true. E.g visit this site : http://zmatrix.sourceforge.net , download and install it on an XP. you will see thats possible.
I just dont know, how...
Moore
|
|
|
|
|
Hello!
If you know some DirectX/DirectShow you could try creating an overlay for the screen, set the desktop to overlay-color and play the movie file you wish onto the overlay surface. That could work, but you would get ugly results with "shadow" effects like shadowed text under the icons on the desktop.
|
|
|
|
|
Hey everybody
I heard a while ago about an API using WMI that allow me to get notifications of any change of files in the system.
Anyone heard of such API? and if so, anyone can tell me what how it is called?
I looked for it for a while, without much success...
Thanks a lot!
|
|
|
|