|
Im not sure but I think I saw this example on the codeproject a progressCtrl on the statusbar
|
|
|
|
|
Hi experts
I have a dll file .First i used it in c# application it works fine.
But i want to use it in c++ program .I use "dumpbin" command to see the function provided by dll.
but it shows only 9 function (not seen in c#)although in c# i have seen number of function .what is problem.
one thing more "dumpbin" command also shows that this is not a class based dll.
so tell me the below qurries:
1.What is the procedure to use a dll in c++ program
2.how can i use that functions that is used in c# application.
Thanks
manu
|
|
|
|
|
Have you followed link provided in reply to your last post ?
|
|
|
|
|
Yes,I didn't understand completely but i got idea from there.
manu
|
|
|
|
|
It mentions how to use dll in VC++ application.
What problem you are facing then ?
|
|
|
|
|
i use explicit linking
like this
typedef UINT (CALLBACK* LPFNDLLFUNC1)(void);
HINSTANCE hDLL; // Handle to DLL
LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer
hDLL = LoadLibrary("MyFile.DLL");
if (hDLL != NULL)
{
lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,
"DLLFunc1");
if (!lpfnDllFunc1)
{
// handle the error
FreeLibrary(hDLL);
return SOME_ERROR_CODE;
}
else
{
// call the function
uReturnVal = lpfnDllFunc1(void);
}
}
But using "dumpbin" i saw the function that are never seen by me in c# application.Here (c++)it shows only 9 function that are not useful for me.How can i use function that are used by me in c# application by same dll
i am also sending some c# code plz suggest me to use in c++
Redemption.RDOSessionClass Session=new Redemption.RDOSessionClass();
Session.Logon("",0,0,0,0,0);
Redemption.RDOStore NewStore=(Redemption.RDOStore)Session.Stores.AddPSTStore(@"c:\temp\PST1.pst",null,"New PST");
Redemption.RDOFolder NewFolder=NewStore.IPMRootFolder.Folders.Add("Parshant",null);
manu
|
|
|
|
|
manu_2205 wrote: typedef UINT (CALLBACK* LPFNDLLFUNC1)(void);
HINSTANCE hDLL; // Handle to DLL
LPFNDLLFUNC1 lpfnDllFunc1; // Function pointer
hDLL = LoadLibrary("MyFile.DLL");
if (hDLL != NULL)
{
lpfnDllFunc1 = (LPFNDLLFUNC1)GetProcAddress(hDLL,
"DLLFunc1");
if (!lpfnDllFunc1)
{
// handle the error
FreeLibrary(hDLL);
return SOME_ERROR_CODE;
}
else
{
// call the function
uReturnVal = lpfnDllFunc1(void);
}
}
You are right here. Is this code is failing for you ? If yes, where ?
manu_2205 wrote: Redemption.RDOSessionClass Session=new Redemption.RDOSessionClass();
Session.Logon("",0,0,0,0,0);
Redemption.RDOStore NewStore=(Redemption.RDOStore)Session.Stores.AddPSTStore(@"c:\temp\PST1.pst",null,"New PST");
Redemption.RDOFolder NewFolder=NewStore.IPMRootFolder.Folders.Add("Parshant",null);
Looks like use defined classes. What you are trying to do here ?
|
|
|
|
|
Here i m trying to create a pst by class defined in dll file.
for e.g
Redemption.RDOSessionClass Session=new Redemption.RDOSessionClass(); Session.Logon("",0,0,0,0,0);
here Redemption is namespace and RDOSession is a class.
I create a object of that class and call the Logon() method.
Next line creating a pst at spacified location.
and next to create folder in pst.
so plz tell me how can i do this in c++
manu
|
|
|
|
|
manu_2205 wrote: Here i m trying to create a pst by class defined in dll file.
for e.g
Redemption.RDOSessionClass Session=new Redemption.RDOSessionClass(); Session.Logon("",0,0,0,0,0);
Is this dll is created using C#(class library) ? If yes, not sure, If how/it is possible to use in VC++.
You can get some help from C#[^] forum.
|
|
|
|
|
Try to understand me Sir,
Actaully my problem is : According to "dumpbin" this dll is not class dll although function dll while in above program i create a object of class.
And shows different function from Logon(),RDOAddpst(),
What is the reason ,how can i use these function.
manu
|
|
|
|
|
Do you want to use of functions on the dll in your program ?
|
|
|
|
|
Is it possible to lock a folder? to prevent it from being deleted or renamed?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Don't know of any way other than writing a file system filter driver.
« Superman »
|
|
|
|
|
Well I figured it out:
You can create a file handle on the folder -- and set the sharing for read and write, but not delete.
m_FolderHandle = CreateFile(m_FolderName, FILE_LIST_DIRECTORY, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL );
closing the handle will unlock the folder.
I guess I didn't specify -- that I needed to only maintain the lock while my application is running...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc.</A>
|
|
|
|
|
Sir,
I have a list coClass under a typelib for a component. I would like to call methods & properties of a coClass, how can i do that.
I am expecting to get some help from you.
Thanks & Regards,
Praveen A.
praveena@navayuga.co.in
|
|
|
|
|
praveen kumar agarwal wrote: I would like to call methods & properties of a coClass, how can i do that.
I'm not clear about your requirement, Can you use IClassFactory::CreateInstance ?
|
|
|
|
|
I have two coClass under a TypeLib. When I call coCreateInstance() method, it reciprocates with one of the default coClass in TypeLib. I can call methods & properties of default class but if i have to change to another coClass, how can i do that?.
example:
TypeLib has coClass1 and coClass2.
Using IDispatch interface, I can call the default coClass1 and its methods can be invoked.
IDispatch->Invoke()-->it executes default coClass1 methods & properties.
But, if I want to execute coClass2 methods & properties, how can i proceed?
I hope now you are clear about my requirement.
Thanks in advance.
Praveen A.
|
|
|
|
|
praveen kumar agarwal wrote: When I call coCreateInstance() method, it reciprocates with one of the default coClass in TypeLib
It gives you interface (coclass) you requested.
praveen kumar agarwal wrote: But, if I want to execute coClass2 methods & properties, how can i proceed?
You need to use CoCreateInstance for different classes.
i.e. you need to call CoCreateInstance again for different interface, as it will have different CLSID .
|
|
|
|
|
Hi all,
I have insert a Splash Screen in my SDI project in VC++ MFC.
Can any body tell me how can i do this?
please help.
Thanks and Regards
Yudhisthira Attry
Yudhisthira Attry
|
|
|
|
|
|
Help-I Don't know how to set environment path for Mycomputer System properties using MFC coding
|
|
|
|
|
|
Thanks for valueable information
|
|
|
|
|
Do not waste your time on things like the C-RTL and Win32 functions (SetEnvironmentVariable(...) ) to set environment variables - these only affect the process' environment space - other processes will not be affected, nor will you see the change when you bring up up the system properties.
If you need to change these values such that the change remains after your application exists and/or are visible to other application and the system, you will need to modify the registry.
Look up the HKCU\Environment and HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment registry keys for more information on how to do this.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Thanks for your valuable information
|
|
|
|