Click here to Skip to main content
15,314,675 members

Comments by Member 4581741 (Top 32 by date)

Member 4581741 18-Apr-21 17:28pm View
   
I have updated code a little. Please check my updated post. I have posted results.
Member 4581741 18-Apr-21 11:05am View
   
I know how to debug but i feel the way i am approaching the problem is wrong. You can review my code. Any suggestions regarding my initial question, how to solve or what approach should i take in solving that specific problem would be helpful. Thanks
Member 4581741 19-Jul-18 18:11pm View
   
There is id field but CreateDate can be used to know the sequence of the entries for each state.
Member 4581741 19-Jul-18 1:56am View
   
Sorry if the question is not clear.
"You have records where the ID and the state match. 1 & OH, 1 & CO, 1 & NC. The types of each of these records do not match Ret <> DetRet."
The "Type" of 1st entry of each state should match. ID 1 has "Det" as type for each state for 1st entry, and 2nd entry for each state for ID 1 has Type "Redet". So that's good.
For ID3 and ID4 it does not match.
Also, Det and ReDet are just example of Types. It can be any one of 5 values.
Member 4581741 19-Jan-12 17:15pm View
   
I am only to put the modalpopup extender inside Itemtemplate.
If i do so it slows down the website by much as it tried to load the modal for each row of column being generated by gridview datasource.

What i want is that i need to add a button column inside the grid view and when that button is called need to open a popup with some values of that row.
Member 4581741 10-Oct-11 14:43pm View
   
Ok problem is solved. It was me who was making mistake while passing command which i didnt mentioned in this post.

I was just missing new line character while sending commands.

Thanks for posting comments for helping me out.
Member 4581741 10-Oct-11 11:58am View
   
sTest are commands sent to the terminal.
Suppose sText is ATE0 then in telnet i am getting ATE0 and then OK.

sockP_DataArrival is triggered once and i get back "ATE0" but not OK.

I tried different commands where i expect more then 1 reply for a command but i am getting databack just once from the terminal.
Member 4581741 13-May-11 11:39am View
   
Ok i figured out that the header file MainFrm.h is coming from ..\rhub\mainfrm.h.
& in that rhub directory too it has Mainfrm.cpp which has Log function.

Now what do i need to do to call the function from that .cpp?
Should i add that cpp in my project ?

Advice
Thanks
Member 4581741 28-Apr-11 13:36pm View
   
Perfect .. This worked fine ..
Thanks
Member 4581741 28-Apr-11 9:21am View
   
Thanks Nishant.
Perfect.
Now i got an array from my calling application to C++.
Now from this C++ function if i want to pass the array or array values (received from calling app) to C# class library, is there a way to do that.

Please let me know.

Thanks.
Member 4581741 27-Apr-11 8:55am View
   
Actually my question was not completely clear. My bad for that.
Actually the Win32 C++ is just the entry point for the calling application where it will call a function from C# class library and pass the same parameters.
Your code works perfect.

But what i want is that in my Win32 app Test function i am taking the parameters (Test(char **files, int count) passed from calling function Test(string[] files, int count). Just like your solution.

Now i don't want to use the values in the C++ application, but C++ app Test function will call a function from C# class library where i want to use the string array.

Ex: string
void _stdcall Test(char *lFile, int ver)
{
//Initialize COM.
psShrinkGrowD->Test(_bstr_t(largeFile), version);
// Uninitialize COM.
}
Here i am passing string from my calling application to C++ (char *lFile) which in turn calls Test function from C# class library where it is again being read as string.

Thanks
Member 4581741 26-Apr-11 18:54pm View
   
Ok good.
Will give a try tomorrow.

Thank you so much.
Actually i am creating a Win32 wrapper DLL around C# class library because my dll will be used by vb.net and also Delphi.

Also is it possible to create multidimentional array in Win32 C++ ?

Thanks. Appreciated.
Member 4581741 8-Apr-11 11:20am View
   
It worked.
Thanks
Member 4581741 21-Mar-11 16:25pm View
   
Application.DoEvents() solved the problem.
Thanks
Member 4581741 8-Mar-11 8:10am View
   
Here is my function. Could u plz let me know if anything is wrong with the function.
extern "C" __declspec(dllexport)
int _stdcall Test(char *largeFile, char *smallFile, int version)
{
//Initialize COM.
HRESULT hr = CoInitialize(NULL);

IShrinkGrowDPtr psShrinkGrowD(__uuidof(ShrinkGrowD));
long sResult = 0;

psShrinkGrowD->Shrink(_bstr_t(largeFile), _bstr_t(smallFile), version, &sResult);

// Uninitialize COM.
CoUninitialize();
return sResult;
}

I am a bit new to Win32. Also if it is a normal dll i should be able to register dll but i am unsuccessful for that.
Member 4581741 8-Mar-11 1:02am View
   
After adding dll to the System32 folder, running the application gives me external component gives an exception.

Also i am initializing & Uninitializing COM
HRESULT hr = CoInitialize(NULL);

IShrinkGrowDPtr psShrinkGrowD(__uuidof(ShrinkGrowD));
long sResult = 0;

//psShrinkGrowD->Shrink(_bstr_t(largeFile), _bstr_t(smallFile), version, &sResult);

// Uninitialize COM.
CoUninitialize();
Member 4581741 7-Mar-11 21:07pm View
   
I have different functions for shrinking the file, growing the file, checking the version, testng crc.
Example of shrinking function is above. Implementation is same which calls functions from my Class library.
I hope u got a bit idea about my application.

Let me know if can help me to create DLLRegisterServer function.

Thanks
Member 4581741 7-Mar-11 20:18pm View
   
Ok .. so i have the function named Test in my .def file.
LIBRARY "1WIN32"
EXPORTS
Test
Now i build the application & dll is created. How can i register the dll ? Let me know.
Thanks
Member 4581741 7-Mar-11 18:24pm View
   
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE gives me error unresolved external symbol DllRegisterServer
Member 4581741 7-Mar-11 18:12pm View
   
extern "C" __declspec(dllexport)
int _stdcall Test(char *largeFile, char *smallFile, int version)
{
//Initialize COM.
HRESULT hr = CoInitialize(NULL);

IShrinkGrowDPtr psShrinkGrowD(__uuidof(ShrinkGrowD));
long sResult = 0;

psShrinkGrowD->Shrink(_bstr_t(largeFile), _bstr_t(smallFile), version, &sResult);

// Uninitialize COM.
CoUninitialize();
return sResult;
}
Member 4581741 7-Mar-11 17:36pm View
   
I have used __declspec(dllexport) in all the functions i used.
& have added the function name in .def.
Member 4581741 25-Feb-11 14:37pm View
   
I think my problem is solved.
Your document was really helpful.
Thank you.

This helped me too:
http://support.microsoft.com/kb/828736
Member 4581741 25-Feb-11 14:10pm View
   
Problem:
namespace GS
{
public interface ISGD
{
unsafe int S(char* lF, char* sF, int vr);
unsafe int G(char* lF, char* sF, int vr);
};
public class SGD : ISGD
{
}

Creating .tbl and imported it.
#import ..path..
using namespace GS;
its fine.
Now created test function.
Inside that if i do GS:: i am getting __GlobeShrink (showing as struct)
Doing GS::__GS gs(__uuidof(SGD)); //gives me error.
error C2065: 'SGD' : undeclared identifier
error C2079: 'gs' uses undefined struct 'GS::__GS'


I have a struct defined in the class library. Is it showing that ?
Why i am not getting interface name in it?

Member 4581741 25-Feb-11 11:59am View
   
So in my class library where there are entry points i need to create an interface which will contain the declarations of the functions which i am going to use in Win32 Dll.
And need to inherit that to class in my C# CL.

Just correct me when i am wrong please.
Member 4581741 25-Feb-11 11:33am View
   
No i am not. I am reading through the chapter.
If any doubt will come back.
Thanks for the link.
Member 4581741 25-Feb-11 11:07am View
   
No. I already created Win32 Dll and created few functions in that.
Just need to understand how to call external managed DLL and use functions in this unmanaged Win32 Dll.
Thanks
Member 4581741 25-Feb-11 10:44am View
   
Thank you for the link. But i need to create Win32 Dll.
So can u provide with a link for COM Interop to access Dll.
Thanks
Member 4581741 25-Feb-11 10:32am View
   
I know C++.
Can u please provide with a link with good reference.

Thanks
Member 4581741 25-Feb-11 10:30am View
   
I have created new Win32 Dll project.
Adding reference doesn't show COM.
Member 4581741 22-Feb-11 8:21am View
   
No John is right too. Eliminating lamda makes it simpler to use. I just tried ParameterizedThreadStart and it eliminated my error too without assigning it to temporary string.
Think lamda functions in a different way.
Member 4581741 14-Jan-11 8:40am View
   
No .. i can use unmanaged code too.
I just want to copy the content located at source memory location to destination memory location x no of characters.
Member 4581741 13-Jan-11 15:49pm View
   
I am using interopservice but i dnt knw the syntax to copy the string content to a specified location.

I think there should be something in C# directly which can do that.