Hi, I have a C++ executable that consumes c# class library by importing the corresponding .tlb file. All works fine, except when I debug c# assembly by setting C++ executable as an external program, all the breakpoints in c# code says "The breakpoint will not currently be hit. No symbols have been loaded for this document" FYI, I can debug C++ code, that's attached as an external program. Below are few steps, I have already tried so far, but have no success. 1. Unregistered c# assembly and registered it back 2. Modified GUID and interface name, registered new assembly manually Other details... 1. I am on Visual Studio 2010 2. For c# assembly, .NET target framework is 2.0, Register for COM interop is checked 3. I am using Win7 64 Bit version Please let me know, in case any further details required. Many Thanks
PankajB
Posts
-
Problem debugging c# assembly (class library) -
Rounding double to a provided decimal placeConverting double to CString can be done, but to round off the same will take lots of permutations and combinations because we dont know upto what decimal place we need rounding. If I am wrong then please let me know, and in case you have some pointers then do let me know that as well. Thanks PanB
-
Rounding double to a provided decimal placeHi All. A very simple question, but so far not able to find any concrete solution. I just want to round a decimal value to a provided decimal place. I have found few functions to do the same, but they also fail for some double values...like...
double Round1(double dbVal, int nPlaces)
{
const double dbShift = pow(10.0, nPlaces);
return floor(dbVal * dbShift + 0.5) / dbShift;
}double Round2(double value,int pos)
{
double returnValue;
double tens = exp(pos*log(10.0));
if((value - floor(value*tens)/tens)*tens >= 0.5)
returnValue = ceil(value*tens)/tens
else
returnValue = floor(value*tens)/tens;return returnValue;
}
Both of above function fails in case the double value is 10430.889999999999 464.45999999999998 3294.5100000000002 Please suggest. Thanks PanB
-
Unhandled exceptionThanks Richard. It worked. I really working hard with Google but when was not able to get any solution, then only came for expert advice. Thanks anyway. Keep up the good work.
-
Unhandled exceptionHi There. How to catch exceptions occurred in DLL. For example main() { try { calling the “A.DLL” (DLL(donot know the source code) is generating unhandled exception, access violation) } catch(...) { //Source Code } } Even if I have catch(...) I am not able to catch the exeption. It says unhandled exeption..... Access violation reading.... How I do catch it in my main program so that I can terminate it properly? Thanks -PanB
-
Want to paste a file programatically (using C++) that's available in the clipboardHi All. I can copy a text and then can programatically paste the same on top of any text editor. Now, what I want to do is... If I have a file in the clipboard (Ctrl+C) and then want to paste the same onto any open folder, then How can I do that? I tried to send Ctrl+V to the window but I am unable to get the result. Can someone please provide me some pointers, so that move ahead? Please let me know, in case any clarification required. Thanks PanB
-
MSMQ: Problem with qInfo->PathName settingMore info: I want to place a message from MachineA to MachineB's Message Queue. So, I have to access the message queue on MachineB using its IP Address itself. Any pointers/suggestions will be highly appretiated. Thanks.
-
MSMQ: Problem with qInfo->PathName settingcatch(_com_error &e) e.Source() -> MSMQQueueInfo e.Description() -> The queue path name specified is invalid.
-
MSMQ: Problem with qInfo->PathName settingI do not get any error message as such. But when I try to open the queue...i.e., qDest = qInfo->Open(MQ_SEND_ACCESS, MQ_DENY_NONE); I got an exception. Please let me know, in case you need any further details. Thanks anyway for your effort.
-
MSMQ: Problem with qInfo->PathName settingHi There. My problem is: I am able to send messages to the queue using my machines name, but am unable to do the same with IP Add. For example: qInfo->PathName = "MYCOMPUTER\\private$\\PanBQueue"; works fine... qInfo->PathName = "IP ADDRESS\\private$\\PanBQueue"; Fails... Thanks PanB
-
C++ vs. C#It seems that you did'nt get me. Case 1: Win32 DLL is being used by C++ application. Called an exposed function, lets say ABC(). Case 2: Same Win32 DLL is being used now by C# application. Called an exposed function, lets say ABC(). [Previous C++ Application closed. Both of these callings C++/C# are independent to each other]
-
C++ vs. C#I have not done any profiling OR I even dont have any setup like that. Just want to have a view from other side? As per my understanding there should not be any difference in terms of performance. What do you say?
-
C++ vs. C#Ok. Lets say I have a Win32 C++ DLL and there is an exposed function Calculation(). Now if I call this function from C++ Source Code OR if I call this from C# Source code, then will there be any performance issue, as far as function Calculation() is concerned? Thanks.
-
C++ vs. C#Hi All. I have a simple question... Lets say I have a C++ DLL with one exposed fucntion. Now, If this fucntion get called from C++ Source code OR from C# Source code, then do we any difference on the basis of calling language, as far as performace of this DLL[exposed function] is concerned? In case you need any further information, please let me know. Thanks PanB
-
Unicode 5.1 ( Basic Multilingual Plane ) - Language Identification related problemThanks for the reply buddy. Can you please suggest some solution for the second problem mentioned above? i.e., Possibly because not al unicode characters fit into 16 bits?
-
Unicode 5.1 ( Basic Multilingual Plane ) - Language Identification related problemHi There. I am creating an application that will take a document as an input and will find Total Number of languages used to compose the same. I am refering below web link to do the same... http://en.wikipedia.org/wiki/Basic_Multilingual_Plane[^] Let me also share some code snippet with you guys...
FILE *fp;
long unicode;
long c;fp = fopen(argv[1], "r");
if(!fp)
{
printf("File open failed\n");
return 0;
}printf("Input Unicode file: %s\n", argv[1]);
c = fgetc(fp);
c = fgetc(fp);while( (unicode = fgetc(fp)) != EOF)
{
long unicode1 = fgetc(fp);
unicode = (unicode1 << 8) | unicode;
//(0000–FFFF): Basic Multilingual Plane (BMP).
if (unicode >= 0x0000 /*0*/ && unicode <= 0x07FF/*2047*/)
{
if (unicode >= 0x0000 && unicode <= 0x007F) //Basic Latin (0000–007F)
{
unicode_set[Basic_Latin] = 1;
}
....
....
....
}
}
fclose(fp);I got this code from one of my previous projects. But I am not able to understand why are we doing unicode = (unicode1 << 8) | unicode; Also, this method is not able to correctly identify all the chars. Just FYI, I am using VS.NET 2008 with "Charset settings" as "Use Unicode Character Set" Please suggest, if you have any other way to find out, like what all languages we have used to compose a document? Thanks PanB
-
How to get IP Address of the system using MFCWhy MFC? I am getting lots of Windows.h already included related error messages. But if we can get IP Address in MFC then that will server my requirement. Thanks
-
How to get IP Address of the system using MFCHi there. I can find the IP address of current system using below code but that's C++ code...
char* CLogger::GetIPAdd()
{
WORD wVersionRequested;
WSADATA wsaData;
char Name[255];
PHOSTENT HostInfo;
wVersionRequested = MAKEWORD( 1, 1 );
char *IPAdd;
if ( WSAStartup( wVersionRequested, &wsaData ) == 0 )
{
if( gethostname ( Name, sizeof(Name)) == 0)
{
//printf("Host name: %s\n", name);
if((HostInfo = gethostbyname(Name)) != NULL)
{
int nCount = 0;
while(HostInfo->h_addr_list[nCount])
{
IPAdd = inet_ntoa(*(struct in_addr *)HostInfo->h_addr_list[nCount]);++nCount; } } } }
return IPAdd;
}I want to get an IP Address using MFC. Can any one please help me out to get the same using MFC? Thanks PanB
-
::ShellExecute - Problem passing argumentsLet me provide few details... 1. Lets say ABC.exe just cout the text provided as an argument. 2. If I launch ABC.exe from console, >ABC.exe Hello, it prints out Hello on the Screen. 3. if I call the same application like HINSTANCE hInst = ::ShellExecute(NULL, L"open", L"C:\\Documents and Settings\\pankaj.bhalla\\Desktop\\ABC.exe", L"Hello", NULL, SW_SHOW); ...it does not Just FYI, ABC.exe is a Console based Application
-
::ShellExecute - Problem passing argumentsI am basically passing a path to a file. Target application just check whether file exists, if does not then create that file.