|
Hi,
I've heard a lot of those features in Windows XP called side-by-side execution of 'assemblies' and thought it was only available for .NET programs.
But then I consider a description on MSDN showing that even unmanaged DLL's (normal libs and COM libs) could be reside version independent on Windows XP using a XML manifest description.
Now I'm looking for deeper instructions how to use that functionality, but I couldn't find any samples or tutorials on MSDN (only the Platform SDK docs).
Hope anyone can help me by stating a good book, link to a tutorial or even some sample code.
Best regards
Andi
|
|
|
|
|
Search .config in MSDN. Any app can be associated to a .config file with versioned assemblies.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
I am a very junior level professional programmer, and I'm having a problem - and I feel rather foolish about it.
Generally, I've really preferred C++, but I haven't worked with it in some time, and until recently, I used Borland C++ Builder 3.0, which is somewhat old now.
I'm now using Visual Studio 7.0 .NET, and I'm having a couple of problems.
The first is that I'm having a devil of a time with editing a list box. Did this all the time in VB, but VC++ doesn't seem to make it as easy. I've opened up the properties, but it isn't giving me any options for adding data - and the data property in the property list is greyed out.
The other is, how does one add a button or other control to the primary window itself for VC++? With Borland C++ Builder, I could just paint it on. And I can paint them on for dialogue boxes in the resource area. However, I can't find accurate information in the help files. While I am still looking for them, I thought I'd see if anyone out there could help me out with this.
(I should probably get my hands on the books; this is a tool at my workstation I'm using, sans instructions. I can program in C++ just fine, but I'll be darned if I can find some of these GUI creation controls in VS .NET).
One last thing: I had found a so-called tutorial in the MFC/C++ section for editing a list box - but some of the screen shots the person had displayed dialogue that I cant seem to bring up. It looked more like my VB 5.0 interface, and such items are not coming up in my VS in the C++ environ....
Thanks!
James A Beggs
Microsoft MSN Mobile Component Test Team
|
|
|
|
|
The best I can say is: Get a book about programming with VC++.
It's way different from what you have tried before, because you have only been using RAD (Rapid Application Development) tools. In VC++ you have to do it all by code...
Take a look at this one.[^]
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Thanks. I work at Microsoft here in Redmond, Wa, as a short term contractor, and they have a company library. So, I went down and got a few books.
Annoying. For my home use, I may have to check out Borland's most recent C++ Builder. One of the versions of it does include .NET material as well.
What is your favorite C++ compilers?
James A Beggs
Microsoft MSN Mobile Component Test Team
|
|
|
|
|
James A Beggs wrote:
What is your favorite C++ compilers?
VC, the one and only
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Haha!
Well, I "grew up" on Borland C++, then picked up C++ Builder 3.0. I liked it, a lot. I haven't used it in awhile, and I am debating on what to get, Borland, VC, or something else.
James A Beggs
Microsoft MSN Mobile Component Test Team
|
|
|
|
|
I have been looking at solving some "inconsistent" problems with my program which seemed to be memory related. Strings displayed in dialog boxes overwritten when there was no command to change them. In order to check that I did a build with Boundschecker. Although I am not sure how I fixed my own problems , after a few full rebuilds and initializing data in the pointer class I was using, my code seemed to solidfy. However bounds checker gave me a list of memory leaks within external dlls. (i.e.
Dynamic memory overrun
Copying 65535 bytes to a block allocated in DNSAPI.DLL!0000121A
Starting offset: 0, destination size: 2 bytes
HANDLE: 0x0016B5A8
allocating thread ID: 0x6DC, current thread ID: 0x6DC
Location of Error
DNSAPI.DLL!0000141D (unknown) (unknown)
DNSAPI.DLL!000015BA (unknown) (unknown)
DNSAPI.DLL!00002AAF (unknown) (unknown)
DNSAPI.DLL!000029E4 (unknown) (unknown)
DNSAPI.DLL!0000298F (unknown) (unknown)
Point of Allocation
DNSAPI.DLL!0000121A (unknown) (unknown)
DNSAPI.DLL!00002AAF (unknown) (unknown)
DNSAPI.DLL!000029E4 (unknown) (unknown)
DNSAPI.DLL!0000298F (unknown) (unknown)
or
Memory leak
1152 bytes allocated by MSVCRT.DLL!0000101F in MSVCRT.DLL!00003517, HANDLE: 0x01F31F20
Location of Error
MSVCRT.DLL!00003517 (unknown) (unknown)
MSVCRT.DLL!00001431 (unknown) (unknown)
Is there a way to debug this.. I assume it is something that I am doing in the calling of the API and MFC code. Okay I am one that doesn't want to just blame Microsoft and release something with errors that I can resolve.
Unfortunatly I am not a debug guru and haven't been able to study under any master, so any help could be cool. Otherwise when I get time, I guess I could comment out calls and find out what is causing these leaks. Trust me I learned alot debugging my AddRef/ Release extremly simple garbage collection for some classes. I learned I should probably have used a better smart pointer class instead of my simple technique....
Anyway thanks for any tips...
The path to mastery is full of stupid moments and errors, but the error of the stupid is to assume that they are masters.
|
|
|
|
|
- you cannot debug MSVCRT
- BoundsChecker is not always accurate. Far from that, type casting makes it easily confused and say wrong things about it. Moreover, you are not telling us whether BoundsChecker reports it is a object leak, interface leak, gdi leak.... If that's an object leak, then MSDEV is likely to show it as well (as a proof whether BoundsChecker is wrong or not).
- Best advice would be :
-- do not use DNSAPI if you can
-- try to use it in another similar program
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
Wish I could not use DNSAPI, but one of the requirements that I have already is that I can resolve an Internet Address by name as well as by numbers, so I have to use it.
I sort of realized that boundschecker is not going to be completely accurate. Many people have posted examples of the way I use gethostbyname, so I will check out one of their programs to see if it is the same problem. Otherwise it must be the way I am using it.
As far as the leak goes... It is labeled as a memory leak. VC++ doesn't record the leak, which is where I normally start. I usually use Boundschecker if I have had a problem that might be memory related. I have learned to ignore resource leaks and gdi leaks unless they are in my code.
Thanks for the help though. I appreciate the feedback...
|
|
|
|
|
Hi all
First off, I know nothin of C++ (well i can read a bit). Now the problem is: I have a static object library (file.lib) and its header (file.h). Now I want to compile this into a static(???) DLL and export the 4 functions available in the header. Is this possible?
I have tried something myself by creating a file.c file and including file.h at the top. I also made a def file with the exports (correct AFAIK) and adding file.lib to additional dependacies in the linker properties. This is why I like C# so much, VC++ has toooo many settings!
Can someone please help? I'm clueless!
Cheers
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
leppie,
I see you are creating a .def file, are you trying to convert this into a .dll that can be called from VB?
Nick Parker
The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
|
|
|
|
|
Nick Parker wrote:
I see you are creating a .def file, are you trying to convert this into a .dll that can be called from VB?
C# really, but yes!
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
leppie wrote:
First off, I know nothin of C++ (well i can read a bit). Now the problem is: I have a static object library (file.lib) and its header (file.h). Now I want to compile this into a static(???) DLL and export the 4 functions available in the header. Is this possible?
Yes.
Let the wizard generate a DLL project for you. I prefer to use (MS specific) __declspec keywords instead of a DEF file.
Pavel
Sonork 100.15206
|
|
|
|
|
Pavel Klocek wrote:
Let the wizard generate a DLL project for you. I prefer to use (MS specific) __declspec keywords instead of a DEF file.
OK I rephrase, I know nothing of Visual C++
What wizard must I use? what is this precomopiled header, do I need it? I dont really want answers to these. I just too much for me, but the compiler complains to what ever I do, so I just remove them.
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
leppie wrote:
What wizard must I use?
AppWizard "Win32 Dynamic-link library" in VC6, should be in VC7 too. It generates a dummy DLL project with some optional example code.
leppie wrote:
what is this precomopiled header, do I need it?
No, you don't need them, if you turn of use of precompiled header files in your project settings (C/C++ section). The purpose of precompiled headers is to speed up the compiling - selected header files are compiled only once per project, otherwise they are compiled with every cpp file where included again. The stdafx.h file marks a point, where the precompiled headers ends in your cpp file, following includes are compiled as usually.
Pavel
Sonork 100.15206
|
|
|
|
|
A .def file (where you list exported functions) is of the form :
LIBRARY "COMServerPS"
DESCRIPTION 'Proxy/Stub DLL'
EXPORTS
DllGetClassObject @1 PRIVATE
DllCanUnloadNow @2 PRIVATE
GetProxyDllInfo @3 PRIVATE
DllRegisterServer @4 PRIVATE
DllUnregisterServer @5 PRIVATE
To replace your static library with a DLL, you have at least two options :
- edit the existing .dsp file :
-> replace 0x0104 to 0x0102 (in the TARGTYPE line)
-> remove -lib (in link.exe -lib)
- create a new .dsp
-> VC6 : Win32 dynamic library
-> VC7 : Win32 project (and then check DLL in the propertysheet)
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
Ok my exports does look like it, it compiles to a 286kb blob of #$%#$
But the exports viewed in w32dasm doesnt point anywhere.
This is what I not wanted in the 1st place, A lesson in C++. I just want to use the dll from C#, but it is distributed as a lib and I'm clueless how to do the conversion to dll.
Can I mail it to someone willing to do it? It's just 4 functions. Its small 160kb. Please
Thanx in advance!
Give them a chance! Do it for the kittens, dear God, the kittens!
|
|
|
|
|
The scenerio: if I start my application from the task bar I cannot use the open or new dialog menu options. It will not open the "save" or "open" dialog boxes. However if I start the application using the icon shortcut from anywhere on my hard drive, the application works normally. The application is effected the same way if I use the start menu. Is there something different with the Task Bar that would affect win32 applications in this fashion?
Thanks!
|
|
|
|
|
It seems to work in all the tests that I did.
Is the save/open dialog invoked by your code or is it the MFC framework code?
modified 29-Aug-18 21:01pm.
|
|
|
|
|
In each case where I'm expecting a dialog to open is when I'm involking the CFileDialog class. That is, when saving I call this class with the proper constructor to open a save dialog box and similiarly when I call open.
thanks!
"Why are we hiding from the police, Daddy?"
"We use VI, son. They use Emacs."
|
|
|
|
|
Hi,
I'm sure there is a easy method for this, but I cannot see for looking !
Q. Is there any method to force the Nonclient area of a window to be redrawn/recalculated ?
The only methods I can see, affect the client area of a windows.
At the moment I am increasing the size of the windows then reseting it back to the original size.
My other solution was to recreate the window.
Both of thse solutions work, but they are obviously work-arounds, and I would like a more "professional"
solution.
Thanks,
Gary Ranson.
|
|
|
|
|
Call RedrawWindow with RDW_FRAME.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Now I am developing a tool to simulate user input (keyboard and mouse input) to other applications on windows. The problem seems to be the program doest not work like I expected when I use SendMessage or PostMessage to send keyboard and mouse input to other applications. For example, the user input steps are: mouseclick an editbox in an application’s window, type a string , and then mouseclick another editbox in the window , type another string ; First I send a mouse message to the first edit box to get focus, and send keyboard messages to type the string in the first edit box, then send a mouse message to the second edit box to get focus, and send keyboard messages to type the string in the second edit box. But the result is not what I expected. What’s the matter at all? And if I post a mouse message to click a button, then open a model dialog, but I send any message to the controls in the dialog box , nothing happed. I expect my program can work like some testing tools, such as QARun, Robot etc., to control applications and simulate user input. How should I do? Can you give me some suggestion? Thank you very much!
waiting for your help ^_^
xia
|
|
|
|
|
look at keybd_event() and its brother mouse_event()
...make it about Visual C++, and don't ever mention Visual Basic. Nick Hodapp (MSFT) in Semicolon[^]
|
|
|
|
|