Is the __declspec( dllexport ) hard coded in the header? If so you might try forward declaring the prototype with dllimport and try that. Thank You Bo Hunter
Bo Hunter
Posts
-
exporting global operator+ function from DLL -
const type;Is it possible to find out if a type was declared const? Thank You Bo Hunter
-
Memory Management across DLLsI am with you on this. The guideline that I go by. objects that are instantiated inside a dynamically loaded library must be deleted inside the same library. If the object is deleted inside the program itself, the results are unpredictable. It may work fine, or it may cause a memory leak or even a program crash. If your program redefines new or delete, a program crash is almost guaranteed. Thank You Bo Hunter
-
Compiling MSIL and c#Will ILASM not work? Thank You Bo Hunter
-
caveats when using _malloc_dbgthe docs on msdn say that you must use _free_dbg. Thank You Bo Hunter
-
can't use "new" with gdiplus objectsI beleave that this will do everything you need. #pragma push_macro("new") #undef new #include #pragma pop_macro("new") Thank You Bo Hunter
-
Bits;That is exactly what I needed. Thank You Bo Hunter
-
Bits;I have used a bit mask before but how does one extract individual bits. Say I wanted to extract bit 28 from 32 bit int, how do I do that? Thank You Bo Hunter
-
How to access Radio Button with just IDCheck out CheckRadioButton api on msdn. Thank You Bo Hunter
-
Diffrence between VC++ and managedIL is compiled to native code before it is executed. It is not like java byte code that is interpreted. Thank You Bo Hunter
-
C++/CLI Array problemI believe mscorlib.dll is the only automatic import, but I have been wrong before. Thank You Bo Hunter
-
disable the Task managerThis is what I use to disable the task manager during games and such. Regsitry Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System Key DisableTaskMgr Thank You Bo Hunter
-
C++/CLI Array problem#using using namespace stdcli::language; That may help. Thank You Bo Hunter
-
Converting byte[] to Hex String;You know something Heath; don’t answer any more of my post. You have a big chip on your shoulder. I have never seen you correct someone's Spelling before, all you are doing is being a smart ass. It is because of me posting some of your previous posts when you start bashing people for not doing this and not doing that. What is your problem? I could understand that being vague or something but to start a post with ("Specific". "Pacific" is the world’s largest ocean.) Is nothing more than the arrogant, self absorbed, inconsiderate prick that you are. Now did I misspell anything this time? This is what Heath Stewart thinks about Certifications. Heath Stewart said "Personally, I am not certified because I really don't want to be. I know a large number of people with certifications that know crap. They studied for the tests, memorized a few things, took the tests (sometimes a couple times) and got their certs. They're still idiots."
-
Converting byte[] to Hex String;I should have been more pacific. What I ment by the part I am having trouble with is the last while loop is it does not work. These lines are the problem.
*ch3++ = *( ch2 + ( 2 * (( *b2 & 240 ) >> 4 )));
*ch3++ = *( ch2 + ( 2 * ( *b2 & 15 )));
b2++;What I am going by is the hash returned for a certain byte[] does not match the result from the same function with the same byte[] in the BCL. Thank You Bo Hunter
-
Converting byte[] to Hex String;I know that this is possible.
internal static string ByteArrayToHexString( byte[] buf )
{
StringBuilder sb = new StringBuilder( buf.Length );
for ( int i = 0; i != buf.Length; ++i )
{
sb.Append( buf[i].ToString( "X2" ) );
}
return ( sb.ToString() );
}But I found this code in the BCL and was just trying to make it work. The trouble I am having is in the lowwer while loop. From what I can see is it is supposed to index into the s_acharval array that contains the valid hex digits. But I have had no luck in figuring it out.
internal unsafe static string ByteArrayToHexString( byte[] buf, int iLen )
{
char[] chs1 = s_acharval;
if ( chs1 == null )
{
chs1 = new char[16];
int i = (int)chs1.Length;
while ( --i >= 0 )
{
if ( i < 10 )
{
chs1[i] = (char)( 48 + i );
}
else
{
chs1[i] = (char)( 65 + ( i - 10 ) );
}
}
s_acharval = chs1;
}
if ( buf == null )
{
return null;
}
if ( iLen == 0 )
{
iLen = (int)buf.Length;
}
char[] chs2 = new char[(uint)(iLen * 2)];
fixed ( char* ch1 = &chs2[0])
{
fixed ( char* ch2 = &chs1[0])
{
fixed ( byte* b1 = &buf[0] )
{
char* ch3 = ch1;
byte* b2 = b1;
while ( --iLen >= 0 )
{
*ch3++ = *( ch2 + ( 2 * (( *b2 & 240 ) >> 4 )));
*ch3++ = *( ch2 + ( 2 * ( *b2 & 15 )));
b2++;
}
}
}
}return new String( chs2 );
}
Any help would be greatly appreciated. Thank You Bo Hunter
-
MFC Help;I have this cd burning app that I have been working on. I added a dialog to show progress along the way. Now this dialog implements a interface and these methods are called during the burn. (These methods are callbacks that windows calls duriing the burn. So surely they are called from a different thread) I added some members to represent the controls on this dialog, 2 CStatics and a CProgressCtrl. I added the DDX_Control stuff. Now I know that I am not supposed to work with a control from different threads other than the one it was created with. If that is the case how do I set the window text and the progress step from these methods? Thank You Bo Hunter
-
How can I get a jpeg picture's array of pixels by using GDI+?Check out the Bitmap class on MSDN check out the LockBits method. Thank You Bo Hunter
-
ATL bug with CComPtr and VS2003 ?Could you show the lines that give the ambiguous conversion error? Thank You Bo Hunter
-
Returning WCHAR* variable;I am trying to return a WCHAR* from a function. The WCHAR* variable will be Marshalled to managed code with Marshal.PtrToStringUni. If I don't new it then PtrToStringUni returns the wrong result or nothing. This does not work.
WCHAR\* GetRecorderDriveLetter() { WCHAR drive\[4\] = {0}; m\_hr = (\*this)->GetRecorderDriveLetter(drive, 4); //TRACEHR(\_T("CCDBurn::GetRecorderDriveLetter"),m\_hr); return (drive); }
This does.
WCHAR\* GetRecorderDriveLetter() { WCHAR\* drive = new WCHAR\[4\]; m\_hr = (\*this)->GetRecorderDriveLetter(drive, 4); //TRACEHR(\_T("CCDBurn::GetRecorderDriveLetter"),m\_hr); return (drive); }
What I am worried about is a memory leak. How does the memory get freed? Thank You Bo Hunter