|
Maybe you need to become better at sleeping. I'm an expert at it
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
I posted this question a while back ago in some news groups but never got an answer... since this place is where all the experts hang out anyway I'm making a new go at it... so here goes...
Does anyone know the requirements for getting PDH to work on different versions of NT machines? PdhConnectMachine() gives a very general error message saying it can basically be anything from Charon not being inline with Pluto, humidity being too high in India or to more exactly quote the MSDN:
PDH_CSTATUS_NO_MACHINE
"Could be caused by the machine not being on, not supporting PDH, not being connected to the network, or having the permissions set on the registry to not allow remote connections or remote performance monitoring by the user."
So which is it?! I know from my own research that the 'Remote Registry Service' has to be running on Windows 2000 but what about NT4 and XP... and how come there's 12 inches in a foot?
// Anders
|
|
|
|
|
I must provide dll that will match to every language !!!
I did exctention dll that works well in vc but NOT in another.
after all the suggestions that I gets from the books and from you (and thanks!) I understood that the best way for me (as beginner at this subject) is to use the Wizard of ATL COM with suppot MFC)and imported in my mfc dll.
When I run it by client program (exe) the atl it works !
but the imported function (ShowDialog) dont performed. WHY ????????
------------------------------------------------------------
My steps:
1. I opened project: ATL COM Wizard. [DLL] [MFC Support]
2. I inserted to the library that created the file : MyMfcDll.dll
and attached to the ATL project the files : MyMfcDll.h , MyMfcDll.lib
3. I Added by wizard ATL class [MyClass] [single] [dual]
4. I added by wizard method [ShowMfcDialog] to IMyClass and fill it so :
___________________________________________
extern "C" __declspec(dllimport) void ShowDialog();
STDMETHODIMP CAtlObj::ShowMfcDialog()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())
AfxMessageBox(".....");
ShowDialog();
return S_OK;
}
-----------------------------------------------------------
Please Try HELP me !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
Your JOB is on the line and you've not bought a book after three weeks ? Sheesh.
I maintain that your best bet is to create a NEW dll, with MFC support if you must, and replicate the functionality of your non-COM dll from scratch. It's mainly cut & paste, but doing it that way means you don't need to worry about the other dll.
Did you trace into the function like I suggested ? What happened ? You've been asking this same question verbatim for two days so I presume you've done something about every suggestion you've recieved.
ATL is not stupid, it simply requires some effort to learn. Which is why I keep telling you to buy a book, because you're NOT going to learn ATL from a web post, or even MSDN unless you have time to spare.
Christian
|
|
|
|
|
1. I think that I must exctention dll because I need in : CDialog.
2. Is in my steps that I described it seems that is all right or something wrong or missing ?
3. When I trace into the function I see that it doesnt enter to the dll function.
4. Believe me that I try to learn it from books and that is what I unterstood that I have to do.
5. Please understand that all the subject of com/dll/atl was not known me untill two weeks all !!!
|
|
|
|
|
1. You can build a COM dll with MFC support - my understanding is that you're build one dll out of another. I don't know much about dll's, maybe you *do* need to do this. If I were you at this late stage I would probably consider that as you've asked the same question for days, you consider if MFC is the problem, do you need MFC support ?
2. Like I said, I don't know much about dll's, although I know a little about ATL.
3. So when you trace into the function that calls your dll, it brings up the AfxMessageBox, but you can't step into the function from your dll, it just goes over the top ? Given how dll's export their functions, doesn't that mean it's lookup table has a problem ?
4. I'm sorry, if you did in fact buy one of the books recommended, it didn't help you at all and as you never said, it was not obvious. I can only maintain that you should consider building it entirely in a COM server dll, regardless of MFC. If you only need MFC to bring up a dialog, bringing up a dialog using ATL is not very hard at all, Win32 is probably easier because of the mass of information available.
5. If your boss is going to sack you for not being able to impliment something you didn't know about two weeks ago, then he is an ass, and you can tell him I said so. It's been obvious all along that you're out of your depth ( and that is no insult, there are a myriad of technologies where I would be in the same boat, no-one knows everything ). Does your boss know you're in trouble ? Is your boss tech savvy at all ( can you talk in terms of ATL, or do you have to talk in terms of the pretty colours ? )
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I trys now to build ATL without import the MFC DLL that I crated.
So
1. I going to resources and inserting Dialog.
2. I created class dialog::CDialog (possibility ?)
3. I added ATL class - simple.
4. I added to this ATL class object from the class dialog .
5. I added to this ATL class method that doind : dlg.DoModal();
I run it from client program and it is works so :
It shows the dialog of the method of ATL class (in number 5)
But when press OK or Cancel it is crush.
____________________________________________________-
Have I use only in ATL dialog or there are a way to works as I tried (Maybe have I added AFX_MANAGE_STATE somewhere)?
|
|
|
|
|
Is the ATL dialog class called CDialog ? The ATL Object dialog allows you to add a dialog box, is that how you did it ?
Your biggest problem is that when something crashes you bring up CP. People could help you more if you provided some info. Did you trace into the code to see what line crashed ? You should post some code, and also know where it crashed exactly. Then we could help you more. Why don't you email me your project, I'm at home right now playing Worms, and I'd be happy to bring it to a point that your ATL dialog comes up. Just zip it ( without any intermediate files, just the stuff I need to compile it ) and send to cgraus@viewbuild.com
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I'm sorry, I'm going to bed. Maybe tomorrow night I'll have time to have a look for you if you decide to send it to me.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
In MSDN, it is said:
DllMain is a placeholder for the library-defined function name.
I do not know what means "placeholder" and "library-defined function name" here.
Can you show me an example or a description?
Thanks,
Maer
|
|
|
|
|
It means that you can name the entry point anything you want. The docs use "DllMain" as an example.
--Mike--
http://home.inreach.com/mdunn/
"....." -- Silent Bob
your with and
|
|
|
|
|
Thanks Mike!
I still have a question. I still do not know what means "library-defined".
Can you show me an example?
Best regards,
Maer
|
|
|
|
|
|
Thanks Mike!
Your answer is the one I am looking for. : )
Regards,
Maer
|
|
|
|
|
What is the function of "UNREFERENCED_PARAMETER" in DllMain?
Thanks,
Maer
|
|
|
|
|
1) It tells other people that may be maintaining your code that you purposely are ignoring a function parameter.
2) It avoids the level 4 warning about unused function parameters.
--Mike--
http://home.inreach.com/mdunn/
"....." -- Silent Bob
your with and
|
|
|
|
|
Hi, again pal!
I meet with another problem now. My function is like this:
void fun(int a, ...)
{
UNREFERENCED_PARAMETER(a);
...
}
But now, I want to modify the function. And I will use parameter "a" in my modified version of my function.
Should I remove the statement "UNREFERENCED_PARAMETER(a);"?
Hope you can help!
Best regards,
Maer
|
|
|
|
|
Hi:
I try to immigrate netants-like floating basket to WinCE, The original one works properly on Destop Window, but on WinCE, the basket window maxmize, occupying full screen. Is there WinCE expert can help me? Thanks for you helping in advance!
Best Regards
Tony Wu
|
|
|
|
|
I've got a class to create a window in Win32, and one to create a bitmap button. When I resize the window, I've tried calling MoveWindow or SetWindowPos, both cause the buttons to flicker terribly. I know the problem is here because I killed all drawing in the window, so the background is never drawn at all. Can anyone suggest if there is anything I can do to make my buttons move nicely without flicker ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hi,
U need to use LockWindowUpdate(which temporarily stops
the WM_PAINT mesgs) and after ur
moving is completed, call UnlockWindowUpdate
to again continue drawing.
Hope it helps....
|
|
|
|
|
It sounds like your WM_ERASEBKGND handler repaints the entire background. If that's the case, it's painting over the buttons, which in turn have to be repainted, and thus you get flicker.
First thing I'd try is, in your WM_ERASEBKGND handler, only repaint the necessary portion (by calling GetUpdateRect()) so you won't always paint over all your buttons.
--Mike--
http://home.inreach.com/mdunn/
"....." -- Silent Bob
your with and
|
|
|
|
|
Would this be the case even if I set the PaintStruct's erase member to FALSE ? I did that and also stopped my own code from drawing a rectangle over the area, so that the Window background was whatever was under it on creation ( because it was never drawn ), but it still flickers on resize. The above suggestion did not help either, although I was glad to learn the function existed, it did not solve the problem.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
*scratches head* hmmm, so when you do nothing in WM_ERASEBKGND the flicker goes away?
--Mike--
http://home.inreach.com/mdunn/
"....." -- Silent Bob
your with and
|
|
|
|
|
No, the flicker always remains. The buttons are owner drawn bitmap buttons and it's obvious when I have a lot that they are all being drawn grey and then the owner drawing code draws the bitmaps over them afterward, so the ones at the end of the list are noticably blank before each draw during the sizing process.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
OK, so your WM_ERASEBKGND handler is out of the picture. Something is invalidating your buttons, maybe it's a WM_WINDOWPOSCHANGED, WM_SIZE, or similar handler in your button class?
--Mike--
http://home.inreach.com/mdunn/
"....." -- Silent Bob
your with and
|
|
|
|