G
Guest
Hi All,
My requirement: I want to use TestDll.dll(ATL COM DLL, Threading Model -
Apartment, Interface - Dual and Aggregation - Yes) in ASPX pages.
I created type library for TestDll.dll (ATL COM DLL) using tlbimp
from VS2005 command prompt. Output is TESTDLLLib.lib(.NET Assembly). It has
only one function which is CreateFileInCDrive(). It just creates one text
file in C
Drive.
code snippet:
STDMETHODIMP CMyTest::CreateFileInCDrive()
{
// TODO: Add your implementation code here
FILE* fp = fopen("C:\\TestDll.txt","w");
if (fp != NULL)
{
fprintf(fp,"%s","welcome\n");
fclose(fp);
}
return S_OK;
}
I created asp.net website project and selected code behind as visual c#. I
would like to use atl com dll (TestDll.dll) in Page_Load event. Is it
possible?
In Visual C#, (i mean page_load function) I am able to create object.
But, I cannot create the TestDll.txt file.
I can use this TESTDLLLib.lib in Visual C# Console application. But, it is
now working fine in asp.net with visual C# application. What might be the
problem?
Please suggest me.
Is it correct approach?
My requirement: I want to use TestDll.dll(ATL COM DLL, Threading Model -
Apartment, Interface - Dual and Aggregation - Yes) in ASPX pages.
I created type library for TestDll.dll (ATL COM DLL) using tlbimp
from VS2005 command prompt. Output is TESTDLLLib.lib(.NET Assembly). It has
only one function which is CreateFileInCDrive(). It just creates one text
file in C
Drive.
code snippet:
STDMETHODIMP CMyTest::CreateFileInCDrive()
{
// TODO: Add your implementation code here
FILE* fp = fopen("C:\\TestDll.txt","w");
if (fp != NULL)
{
fprintf(fp,"%s","welcome\n");
fclose(fp);
}
return S_OK;
}
I created asp.net website project and selected code behind as visual c#. I
would like to use atl com dll (TestDll.dll) in Page_Load event. Is it
possible?
In Visual C#, (i mean page_load function) I am able to create object.
But, I cannot create the TestDll.txt file.
I can use this TESTDLLLib.lib in Visual C# Console application. But, it is
now working fine in asp.net with visual C# application. What might be the
problem?
Please suggest me.
Is it correct approach?