|
I am using Visual Studio 8.
I created two win32 empty project and created C "Mylib.c" "MyWrapperlib.c" file to get static library Mylib.lib and MyWrapperlib.lib.
I created another win32 empty project and when i link the static library "MyWrapperlib.lib" (with Mylib.lib and MyWrapperlib.lib in library path) with simple C code "TestApp.C" with main(), it is working fine.
I have used windows.h in "Mylib.c" and "MyWrapperlib.c" for FILE operations.
I want to have a GUI application, so I created NewProject->CLR->Windows Forms Application (MyUIApp.Cpp). When i used MyWrapperlib.lib, it gave linking error.
so I created DLL for MyWrapperlib.c by using #define dllexport __declspec(dllexport)
enclosing with extern C
When i use MyWrapper.dll in MyUIApp.Cpp, it is giving below error
"fatal error LNK1107: invalid or corrupt file: cannot read at 0x2B0"
Can some guide me how to create 'C' lib/dll and use it with GUI application.
|
|
|
|
|
sakthii wrote: I want to have a GUI application, so I created NewProject->CLR->Windows Forms Application (MyUIApp.Cpp).
Should have used MFC, then you'd have native code throughout, so you could have used your static library.
However - you can link C++/CLR modules against your static library (meaning you don't need the DLL). In your project proerties, change the "Common Language Runtime support" option to "Common Language Runtime Support (/clr). Worked for me, anyway.
|
|
|
|
|
Thanks for your reply.
I will try.
|
|
|
|
|
Hi.
I have one query , Is plateform SDK come with Microsoft Visual Studio 2005 Installation.
|
|
|
|
|
Depends which version of Visual Studio. I know that for the Express edition it is not installed and for the Professional it is included.
|
|
|
|
|
In addition to Cedric's reply - the version of the Platform SDK that comes with VS2005 (Standard and above) will be from 2005 (when VS2005 was released). This means that it won't be able to access features that came with Vista. If you do want to access features from Vista, then you'll need to install a later version of the PDK.
|
|
|
|
|
Hi
I defined a class like:
class CProfile
{
public:
static CString* pIniFilePath;
....
}
When I compiled it, I got a lot of linker warning which looks like:
warning LNK4006: "public: static class CString * CProfile::pIniFilePath" in ada.obj; second definition ignored
How can I get rid of this warning message?
Thanks,
|
|
|
|
|
It looks like you have the same class declared in two source files.
|
|
|
|
|
You must have a line of the form
CString* CProfile::pIniFilePath; somewhere in your code - where is it? If it's in a header, there's a good chance it's causing multiple definitions of that item.
|
|
|
|
|
Yes, I do.
If this is the case, how can I do?
Thanks,
|
|
|
|
|
Put it in the cpp file of the class, instead of in the header.
|
|
|
|
|
Yes, You are great. it fixes my problems.
I have another Linker question for you.
I built "nurbs" dll. This gives me a lib and a dll.
When I tried to link them. I got a lot of warnings which looks like:
warning LNK4006: "void __cdecl PLib::resizeKeepBasic2DArray<struct PLib::HPoint_nD<float,2> >(class PLib::Basic2DArray<struct PLib::HPoint_nD<float,2> > &,int,int)" (??$resizeKeepBasic2DArray@U?$HPoint_nD@M$01@PLib@@@PLib@@YAXAAV?$Basic2DArray@U?$HPoint_nD@M$01@PLib@@@0@HH@Z) already defined in drawtool.obj; second definition ignored.
Best regards,
|
|
|
|
|
transoft wrote: How can I get rid of this warning message?
Start by reading here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi all,
i m using Beep function on button clicked to generate some alert sound like::
Beep( 750, 300 );
Beep( 550, 300 );
Beep( 750, 300 );
Beep( 550, 300 );
Beep( 750, 300 );
Beep( 550, 300 );
Beep( 750, 300 );
Beep( 550, 300 );
Beep( 750, 900 );
its not generate beep on some PC.
there is any specification of machine for beep generation please tell me.
or tell me any other function or solution that is work on all machines.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: its not generate beep on some PC.
What do you mean by that? May be that PC did not have a speaker?
Did you check the return value of the function? What was it? The doc also states that this function is not supported on the 64 bit versions of XP and Vista.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Yes system have speakers,and i chk the retun value its non zero.
and all machines and 32-bit version.
please suggest me what can i do,or tell me any other function or solution that is work 64-bit version also.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
"_$h@nky_" wrote: please suggest me what can i do,or tell me any other function or solution that is work 64-bit version also.
So, is that an X64 machine where this is 'not working'?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
one of test machine is 64 bit version machine.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Is the PC speaker connected?
Try MessageBeep .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Do other sounds work?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
yes other sounds work properly.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
|
"_$h@nky_" wrote: its not generate beep on some PC.
there is any specification of machine for beep generation please tell me.
If your PC's speaker is there and running well,
Check this registry entry
HKEY_CURRENT_USER\Control Panel\Sound
Check the value of 'Beep' -
if it is "no" (without quotes) change to "yes" (without quotes) and try again.
|
|
|
|
|
Madhu Nair wrote: Check this registry entry
HKEY_CURRENT_USER\Control Panel\Sound
Check the value of 'Beep' -
if it is "no" (without quotes) change to "yes" (without quotes) and try again.
i m checking this value of beep is yes.but beep sound not generated.
please help me for this.
if you know any other function please tell me.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Can anyone tell me what's the different between
CList<CTime,CTime> m_listTime
and
CList<CTime,CTime&> m_listTime
i used either one of these in my program, can't see the different.
*12Code
|
|
|
|