tylerbingham
New member
I am coding a .dll. and I know how to use 1 .dll( you call a pragma commment(lib,"main.dll"), but I was wondering how to use 2 .dll's in a project...................sample code problem::
// dlluser.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "main.h"
char str[255];
int main(int nNumberofArgs, char* pszArgs[])
{
cout<<"which .dll do you want to load( 1 or 2 )"<< endl << endl;
cin>>str;
if(0 == strcmp ("2",str))
{
// #pragma comment(lib,"dll2.lib")
printMessage();
}
if(0 == strcmp ("1",str))
{
// #pragma comment(lib,"dll1.lib")
printMessage();
}
return 0;
}
this does NOT WORK!!!!, I want a way to pick which .dll loads.
Any help would be much appreciated.
p.s. I know you can't use the pragma directive this way, but I am all out of ideas!!
// dlluser.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "main.h"
char str[255];
int main(int nNumberofArgs, char* pszArgs[])
{
cout<<"which .dll do you want to load( 1 or 2 )"<< endl << endl;
cin>>str;
if(0 == strcmp ("2",str))
{
// #pragma comment(lib,"dll2.lib")
printMessage();
}
if(0 == strcmp ("1",str))
{
// #pragma comment(lib,"dll1.lib")
printMessage();
}
return 0;
}
this does NOT WORK!!!!, I want a way to pick which .dll loads.
Any help would be much appreciated.
p.s. I know you can't use the pragma directive this way, but I am all out of ideas!!