|
|
How do I programmatically create shortcuts for .exes?
NULL
|
|
|
|
|
|
We have a situation where a non mfc dll must depend on mfc dll.
When trying to compile, we got an error saying that Windows.h is already included.
When the _WINDOWS_ definition was undeffed, the compile error was gone, however it shows bunch of link errors.
Do you have any idea how to fix this? Thanks a lot!!
NonMFCDll error LNK2001: unresolved external symbol ___argc
NonMFCDll error LNK2001: unresolved external symbol ___argv
NonMFCDll error LNK2001: unresolved external symbol __mbctype
NonMFCDll error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in msvcprt.lib(newop_s.obj)
NonMFCDll error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in MSVCRT.lib(MSVCR71.dll)
NonMFCDll error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) already defined in MSVCRT.lib(MSVCR71.dll)
NonMFCDll error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj)
NonMFCDll error LNK2019: unresolved external symbol __mbctype referenced in function "void __stdcall _AfxAbbreviateName(char *,int,int)" (?_AfxAbbreviateName@@YGXPADHH@Z)
NonMFCDll fatal error LNK1120: 3 unresolved externals
Kurnia
|
|
|
|
|
Have you tried adding mfc71.dll (in your release build) or mfc71d.dll (in your debug build) to the Ignore Specific Library (/NODEFAULTLIB) property?
|
|
|
|
|
That should be mfc71.lib and mfc71d.lib, or mfc71u.lib and mfc71ud.lib in a wide character application.
|
|
|
|
|
Actually the NonMFCDll uses preprocessor _USRDLL. Removal of this and adding of _AFXDLL solved the problem. Thank you all.
|
|
|
|
|
i would really appreciate some simple example of creating SAFEARRAY and inserting couple of strings (probably BSTR, i don't know for now but convertion is not a problem) into it. there's plenty about it on the internet but none of sites seem to provide just a simple exlpanation how it all works...
regards
|
|
|
|
|
scoroop wrote: a simple exlpanation how it all works...
Umm, what do you mean...
I think samples found on internet and MSDN would explain what you need to know to be able to use SafeArrays.
If those for some reason are not detailed enough I doubt the more detailed explanation would be "simple".
Try to rephrase your question and provide a description of what you want to do, why you've picked that particular solution for your problem and explain what doesn't seem to work as expected. This would make it possible for the rest of us to suggest a better solution if there is one and to guide you better when we have a better understanding of your problem.
Questions like "Explain MFC/COM/ATL/.NET" will likely go unanswered and in the best case you'll be provided with links. Always start by browsing among the articles at CodeProject.
--
Roger
It's suppose to be hard, otherwise anybody could do it!
|
|
|
|
|
you're right. i will describe my problem then. i have a COM method, let's say DoSomething(SAFEARRAY** sa). now I know exactly that it requires BSTR strings in SAFEARRAY. i have those strings extracted from something else. they are in std::string but convertion is not a problem as i mentioned before. what i need to do is to initialize SAFEARRAY, put those strings in it and then call the DoSomething method. actually perhaps i should have posted it in COM message board but it's too late now. i'm quite a newbie to COM (i don't really know why my company assigned this task to me... probably they wanted me to learn something else . anyway i saw SAFEARRAY for the first time in my life today and it's not similar to anything else i've used before ;]. and i'm a bit confused... thanks in advance for your answer.
PS MSDN provides really little information about this. i especially mean examples...
|
|
|
|
|
You need to use SafeArrayCreate() which creates a SafeArray of desired type and dimensions/bounds.
Later you have to create BSTRs with SysAllocString() or CString::AllocSysString() and assign each SafeArray element with desired BSTR.
At last you are responsible for cleaning up with SafeArrayDestroy().
Something like this:
SAFEARRAYBOUND bounds = { 0, 1 };
CString theString = "The string";
SAFEARRAY* pArray = ::SafeArrayCreate( VT_BSTR, 1, &bounds );
if( pArray )
{
BSTR* pbstrData;
if( ::SafeArrayAccessData( pArray, &pbstrData ) == S_OK )
{
*pbstrData = theString.AllocSysString();
::SafeArrayUnaccessData( pArray );
DoSomething( &pArray );
::SafeArrayDestroy( pArray );
}
} N.B. The code above is not tested and lacks a for-loop for iterating through the elements in the array, but you should get the big picture by reading it.
Hope this helps
--
Roger
It's suppose to be hard, otherwise anybody could do it!
|
|
|
|
|
Hi,
I have a requirement to save the serialized data in memory. I tried using CMemFile instead of CFile for saving the serialized data in memory. But serialization becomes too slow since the data size is huge. Is there any other way I can save my serialization data in memory instead of a file?
Please let me know if you know any solution.
Thanks.
|
|
|
|
|
maybe something like this:
CSharedFile sf(GMEM_MOVEABLE|GMEM_DDESHARE|GMEM_ZEROINIT);
CArchive ar(&sf, CArchive::store);
obj->Serialize(ar);
ar.Close();
?
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
Hi Chris,
Thanks for your reply. I tried this also. But the problem is I'm using 50 MB data to store in memory. So these classes dont help since it stores data in RAM and it affects the performance. So the serialization is slow. It takes 20 minutes to serialize the 50 MB data. So I need to store the serialized data in hard disk(not in RAM) but not as a file. Is there a way? Please help me if you know.
Thanks for your help.
|
|
|
|
|
senthaaa wrote: since the data size is huge
How huge?
Maxwell Chen
|
|
|
|
|
I need to store 50 MB data.
|
|
|
|
|
Hi everyone,
I'd like to know how can I make a dll in VC++,I need to know all of the way that is exist for making dll in VC++,if there is a link that can help me please tell me.
Best Regards.
Orchid
|
|
|
|
|
maybe it is some helpful to you
here [^] and here[^]
|
|
|
|
|
Dear WhiteSky
Thanks alot for you guid.
Best Regards.
Orchid
|
|
|
|
|
|
Dear toxcct
Thanks alot for your help.
Best Regards.
Orchid
|
|
|
|
|
There is a lot of stuff for creating dll's and articles related to them here on code project. Just search for the right one that suits your needs
_AnShUmAn_
|
|
|
|
|
Dear AnShUmAn
Thanks alot for your help.
Best Regards.
Orchid
|
|
|
|
|
Dear AnShUmAn, toxcct , ..
Thanks alot for your help.
Best Regards.
Orchid
Dear Orchid85
Do you use a Mail-Merge script?
Best Regards,
VuNic.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
[My Current Status]
|
|
|
|
|