|
I have gone though ur help.It seems that we are in the same path.
But there is still error.
Is there anything related with machine configuration?\
I am Win XP Sp2
Or any other library dependency?
Thanks
Prasanth M V
|
|
|
|
|
The following is a working sample:
DLL header
#ifdef CPPDLL_EXPORTS
#define CPPDLL_API __declspec(dllexport)
#else
#define CPPDLL_API __declspec(dllimport)
#endif
class CPPDLL_API CCppDll {
public:
CCppDll(void);
~CCppDll(void);
static int nValue;
};
DLL source
CCppDll::CCppDll()
{
return;
}
CCppDll::~CCppDll()
{
return;
}
int CCppDll::nValue = 0;
Application source
#include "stdafx.h"
#include "..\\..\\CppDLL\\CppDLL\CppDLL.h"
int _tmain(int argc, _TCHAR* argv[])
{
CCppDll::nValue =5;
}
It works fine on my system (VS 2005, Win XP).
Have you checked again your client project settings? What about the little test with Dependency Walker?
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
|
|
|
|
|
Hi ,
I have just gone through your Dll implementation code.
I think we both moving with same implementation.
But still there is error in my PC.
My Build environment details is as follows:
OS – Win XP SP2
IDE – Microsoft Visual 6.0(c++)
I tested the same implementation in another PC which has the same configuration, but the same error.
Thanks
Prasanth M V
|
|
|
|
|
this can occur if u donot define the nValue in ur DLL, but ur code shows u defined the variable,
I see two possibility,
1) u may be linking to wrong export library, that can happen if u r moving projects, but given fixed path.
2) ur error message shows it is not dllimport, it is normal class declaration,
if dllimport then following can be the error message
error LNK2001: unresolved external symbol "__declspec(dllimport) public: static int CMyClass::nValue" (__imp_?nValue@CMyClass@@2HA)
not this
error LNK2001: unresolved external symbol "public: static int CMyClass::nValue" (?nValue@CMyClass@@2HA)
this can happen if ur using different header file, other than that used in DLL project which doesnot have the dllimport keyword
modified on Tuesday, February 19, 2008 7:23 AM
|
|
|
|
|
Hi.
I have 2 web cameras connected to my PC.
capGetDriverDescription retreives:
Microsoft WDM Image Capture (Win32)
The capDlgVideoDisplay macro displays a dialog box in which I can choose between 2 web cameras.
How to switch between web cameras from my code (not using capDlgVideoDisplay macro)?
Or how to enumerate capturing devices and then select one?
Thank you in advance!
TomazZ
|
|
|
|
|
You can't with VFW.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I want to save a bitmap image in Visual C++ 2003.I use the save method of the bitmap class of Gdiplus this way:
Gdiplus :: bitmap mybitmap;
mybitmap.save (L"C:\myFolder\",&bmpClsid);
But I get a win32Error.
Thanks in advance.
|
|
|
|
|
Did you try with CImage class? it has save method.
|
|
|
|
|
I want to use GDIPlus:: Image.
|
|
|
|
|
MozhdehQeraati wrote: mybitmap.save (L"C:\myFolder\",&bmpClsid);
file path error?
something like L"C:\\myFolder\\image1.bmp"
|
|
|
|
|
i Test with this format but get win32error.
|
|
|
|
|
Hi,
Did u start the GDI + engine?
ULONG_PTR m_gdiplusToken;
GdiplusStartupInput gdiplusStartupInput;
GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL);
Bitmap *pBitmap = Bitmap::FromFile(/*File name*/);
CLSID Clsid = {0};
GetEncoderClsid(L"image/bmp", &Clsid))
CString strFilePath = "C://1.bmp";
pBitmap->Save(strFilePath.AllocSysString(),&Clsid);
GdiplusShutdown(m_gdiplusToken);
Prasanth M V
Software Engineer.
|
|
|
|
|
I would like to know the value of win32 error.
|
|
|
|
|
I have downloaded the GINA sample of MSDN and made some changes in order to be able to logon domain with finger print. But I have some problems.
1. Sometimes I see this message while logging on: "There is a time and/or date difference between client and the server." But there is no difference. If I repeat running the virtual machine this message won't appear and rest of the procedure is followed.
2. The virtual machine is a member of a domain but I want to log on locally. What should I pass the "domain" variable to the functions? I have passed "" (empty string) but a message is shown that the user name / password is incorrect. But it isn't the case.
Thanks in advance.
|
|
|
|
|
Hello everyone,
In the following segment, it does not compile because const is qualified on (the whole) type int& not on the near one int, right?
using namespace std;
typedef const int& rcInt;
typedef int& int_ref_t;
int main()
{
rcInt ref = 0;
const int_ref_t x = 0;
return 0;
}
thanks in advance,
George
|
|
|
|
|
George_George wrote: it does not compile because const is qualified on (the whole) type int& not on the near one int, right?
yes,
|
|
|
|
|
Thanks Rajkumar!
My question is answered.
regards,
George
|
|
|
|
|
No,
U are getting error not beacuse of "const", but as it is reference variable.
Does answer make sense????
Prasanth M V
|
|
|
|
|
Thanks Prasanth!
My question is answered.
regards,
George
|
|
|
|
|
so got 2 accepted answers YES aand NO
|
|
|
|
|
Thanks Rajkumar,
Both of them are correct.
regards,
George
|
|
|
|
|
George_George wrote: it does not compile because const is qualified on (the whole) type int& not on the near one int, right?
his question,
rcInt ref = 0;
const int_ref_t x = 0;
both evaluates to a reading const int &x = 0; then how compiler interprets
Prasanth M V wrote: U are getting error not beacuse of "const", but as it is reference variable.
how about rcInt ref = 0; it is also a reference variable.
how the error because of reference variable came here, because in the expression,
const int_ref_t x, const qualifier on reference type (int_ref_t) is ignored and x become the type int &. while compiler interprets rcInt ref = 0, as reference variable of type const int.
|
|
|
|
|
Hi Raj,
I understood from his question that whether "const int_ref_t x = 0; " became error.
int_ref_t x is equivalnet to int& x. Am i right?
Then it will end with error. Does my expalnation make sese??
Thanks
Prasanth M V
|
|
|
|
|
Prasanth M V wrote: I understood from his question that whether "const int_ref_t x = 0; " became error.
No, its not "whether", he know there is a compilation error, his question is whether this is because const is qualified on ( int & ) type, while in the previous statement const is qualified on (int) of reference variable &x.
george_george wrote: In the following segment, it does not compile because const is qualified on (the whole) type int& not on the near one int, right?
Prasanth M V wrote: Does my expalnation make sese??
then what ur "NO" means, does he is not correct that const is qualified on type (int &)
|
|
|
|
|
OK.
Sorry if my statement milead you.
What i meant is that the error is beacause of reference variable, not by const.
Thanks
Prasanth M V
|
|
|
|