|
makom42 wrote:
which works upto the pointer where I attempt to use GetProcAddress to find a function pointer by its name, this always returns null, even though the function I am trying to obtain has been declared with __declspec (dllexport) in the plugin .dll
The trick is to use both extern "C" and __cdecl - this way your function name won't be mangled by the compiler and you'll easily get the pointer:
extern "C" __declspec(dllexport)
void __cdecl ZoopaDoopa(CRuntimeClass *&pViewClass, CRuntimeClass *&pFrameClass)
{
...
}
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Already being done...
I am convinced this is something stupid somewhere... a missing macro definition or something... thanks anyway Tomasz
|
|
|
|
|
1) Check plugin dll with depends.exe. Right click on .dll icon in the Windows Explored and select 'View dependencies'. You'll see the list of functions exported from your .dll. Ensure that function names aren't mangled - they shouldn't contain @ characters and letters/digits appended by compiler
2) If you're absolutely sure that plugin exports the functions, check the GetProcAddress side. Ensure that function name isn't misspelled. Check the HMODULE you're passing to GetProcAddress. If it still fails, call GetLastError() and post result here.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
I wrote an article on some of things your talking about here.
docviewfromdll[^]
The example APP/DLL projects in it show a nice way of loading in plug-in DLL's. You should be ble to extend the interface example to do the kind of things that your talking about.
I am in the process of planning a series of articles on this subject, but just havn't had the time to work on them yet.
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Hi,
I'ld like to have different views in the same canvas.
Something like the VC++ file where we have separate views for workspace and output. But each of them has it own scroll bar, etc.
Can someone help me out with this, or direct me to the link which explains about it...
Thanx in advance...
|
|
|
|
|
|
Using Spy++ I can see when a control is posted a WM_PAINT message. Is there anyway to tell when a control has finished its painting?
Thanks
|
|
|
|
|
The reason that you cannot tell that the WM_PAINT message has ended in Spy++ is because it is ALWAYS posted.
Is there something that you are trying to accomplish and maybe we can help you that way?
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
In the form designer for Visual Studio you can put a number of buttons on top of each other. In fact you can completely cover one with another. But when you select all the buttons on the form every button’s selection rectangle is displayed - even the one that is completely covered. (You can see bottom button’s selection rectangle drawn OVER the top most button even though the bottom button is completely hidden below the top most button.)
I need to know when all the controls (buttons) on a form are done painting so I can then paint my selection rectangles to the screen (and over any covering control).
Here’s the kicker: I’m doing this in C# and there does not seem to be anyway to do this in a straightforward way. (I have a couple other ideas/suggestions that involve overriding each control’s Paint event or using a window atop the main form.) But I’m hoping that there is someway to do this from a low-level windows perspective. Thus my foray into windows messages and my post here in this forum.
I’ve seen the message WM_QUERYUISTATE pop up in Spy++ for a number of windows but there isn’t much documentation for this message. I’m wonder if I can use it or some other message to determine when the form is finished painted so I can go ahead and paint the selection rectangles over the top of the entire form.
|
|
|
|
|
Actually I want to capture the screen whenever it is updated. I know how to capture the screen and store it as bitmap file but I don't know when to capture...I mean how can my program can know about the screen change. Please help me......
C.R.Naik
|
|
|
|
|
If any program on your desktop recieves WM_PAINT then the screen has changed. If you're hoping to capture video, you're better off to go for 15 fps, I mean, if it only captures on change, the end result will be rather jerky....
Christian
We're just observing the seasonal migration from VB to VC. Most of these birds will be killed by predators or will die of hunger. Only the best will survive - Tomasz Sowinski 29-07-2002 ( on the number of newbie posters in the VC forum )
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
you get a strange error message when you post as 'Anonymous'. Instead, a message telling you need to choose a nick would be better?
|
|
|
|
|
This problem has been fixed.
cheers,
Chris Maunder
|
|
|
|
|
I have a frame window with a menu. when i click one menu item, dialog is created. Now after entering some values into the dialog, i click "OK". here i have a problem. That is, I want to get a field value of the dialog into my frame window. This is the code for the command handler.
void MyCFrameWnd::OnDialog1(){
userDialog1 dlg1;
dlg1.DoModal();
// In this handler i want to get a value from
// the dialog
}
Please help me asap
Thanking you
|
|
|
|
|
Use the DDX features to capture data for your dialog.
Basically this will allow you to assign the edit fields and other controls of your dialog to a member variable that you create in the userDialog1 class.
Then after you call DoModal, you will be able to access the member variables of that class and grab the data that you need.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
In your userDialog1 you make control variables for each control to be visible. That is eg. for a Edit-field you have a variable of type CEdit.
Class Wizard can help you with this.
Then, after DoModal() returned with IDOK, you can access the contents of the Edit-field.
Hope this helps
P.S. DDX is evil...
|
|
|
|
|
hi,
I'ld like to create a CListCtrl object using Create(...) in my CView class.
The function declaration for Create is:
BOOL CListCtrl::Create(DWORD dwStyle,const RECT& rect,CWnd* pParentWnd,UINT nID)
Can someone tell me what's meant by nID (fourth argument) and how to set that value??
Thanx in advance...
|
|
|
|
|
just what it sounds like - it's a number you can use to identify the control by, for instance when using GetDlgItem() or identifying it as the source of notification messages. It can be whatever number you feel like using, although if you plan on actually making use of it then it should be unique amoung the other controls on your form.
---
Shog9
Actually I use to find learning in bars when drinking really useful.
It sort of makes a language liquid. - Colin Davies, Thinking in English?
|
|
|
|
|
Hi,
thanx for that info...
now, i created a CListCtrl using the following code:
<br />
CListCtrl* m_ctrlMesgList = new CListCtrl();<br />
CRect rect(0,650,800,800);<br />
<br />
m_ctrlMesgList->Create(LVS_ALIGNLEFT | LVS_REPORT, rect, this, 1);<br />
m_ctrlMesgList->InsertColumn(0,"Date",LVCFMT_LEFT,-1,-1);<br />
m_ctrlMesgList->InsertColumn(1,"Time",LVCFMT_LEFT,-1,-1);<br />
The problem is, no listctrl is created. This piece of code is in CView::OnInitialUpdate()
Thanx in advance...
|
|
|
|
|
tulc_kris wrote:
m_ctrlMesgList->Create(LVS_ALIGNLEFT | LVS_REPORT, rect, this, 1);
Did you check the return value? What was it?
Anyway, you'll probably want a few other styles. Definately add WS_CHILD|WS_VISIBLE . You may also want WS_BORDER .
---
Shog9
Actually I use to find learning in bars when drinking really useful.
It sort of makes a language liquid. - Colin Davies, Thinking in English?
|
|
|
|
|
Hi All,
I have 2 separate applications say X1 and X2,
X1 receives all the data and stores it in a file now this file should be opened through X2
Consider for example,
GetLogic() fn. in X1 gets the logic from the device and stores it into a file and immidiately this file should be opened through X2
This should happen at run time
User intervention will come only once when he selects GetLogic()
I beleive that DDE should be made used but anyone can explain me the procedure or if there is any other method??
Thanks
Uday
|
|
|
|
|
DDE is somewhat of an outdated technology, there are better ways to do interprocess communication in Win32. You could do a number of things to signal your app X2 that the file has been written by X1 including the following:
1. X1 can find a windows handle to your X2 app and send that window a message when it completes its task.
2. Both apps would register a custom message with the function "RegisterWindowMessage". Both apps would pass in a special string that hopefully only your app will register, and when X1 completes its task, it can broadcast the message that is returned from the api and X2 should handle that message.
3. Create a named event in both applications, and X2 will user WaitForSingleObject or some other wait function and wait for the event that you create.
I think I would choose solution 3. There are other possibilities as far as application synchronization, these are just a few that I thought of off the top of my head.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
How to automatically close the view after clicking print button on (file print)preview window?
After calling OnEndPrinting(), the frame will call OnDraw() automatically so that I write pChild->PostMessage(WM_CLOSE) in it.
When printing job is little(a few pages) is OK, but if printing hundreds pages, the problems occur (MFC42D.dll violation). The problem I suppose is because CDC* pDC of OnPrint(CDC* pDC, CPrintInfo* pInfo) is sent to printer very slowly(I can read page number from print dialog), when OnDraw() is executed, view is destroyed, so that pDC is no more existed.
if I delete pChild->PostMessage(WM_CLOSE) from OnDraw(),
no problem at all but blank view will show(no code in OnDraw()).I can close view by clicking close button(upper right corner of window) but this is not allowed.
I also try to hide this view but it doesn't work if program run dozens time(memory leak).
I try to solve this problem for weeks but ...
Please give me your advice. Thanks a lot
YJ
|
|
|
|
|
|
Im having trouble putting icons or other pics such as bmp's or such, for they can display as the output.
I appreciate it, thanx.
-Masta G-
|
|
|
|