Click here to Skip to main content
15,917,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to make Win32 dll depend on mfc dll? Pin
Kurnia Kosasi10-May-06 3:06
Kurnia Kosasi10-May-06 3:06 
AnswerRe: How to make Win32 dll depend on mfc dll? Pin
Andrew Hain10-May-06 3:30
Andrew Hain10-May-06 3:30 
GeneralRe: How to make Win32 dll depend on mfc dll? Pin
Andrew Hain10-May-06 3:33
Andrew Hain10-May-06 3:33 
AnswerRe: How to make Win32 dll depend on mfc dll? Pin
Kurnia Kosasi10-May-06 4:05
Kurnia Kosasi10-May-06 4:05 
QuestionSAFEARRAY question Pin
scoroop10-May-06 3:01
scoroop10-May-06 3:01 
AnswerRe: SAFEARRAY question Pin
Roger Stoltz10-May-06 5:31
Roger Stoltz10-May-06 5:31 
GeneralRe: SAFEARRAY question Pin
scoroop10-May-06 12:57
scoroop10-May-06 12:57 
AnswerRe: SAFEARRAY question Pin
Roger Stoltz10-May-06 23:11
Roger Stoltz10-May-06 23:11 
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 }; // zero-based and 1 element
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 ); // call your interface method
        ::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!
Questionserializing data to memory. Pin
senthaaa10-May-06 3:01
senthaaa10-May-06 3:01 
AnswerRe: serializing data to memory. Pin
Chris Losinger10-May-06 3:59
professionalChris Losinger10-May-06 3:59 
GeneralRe: serializing data to memory. Pin
senthaaa10-May-06 20:27
senthaaa10-May-06 20:27 
QuestionRe: serializing data to memory. Pin
Maxwell Chen10-May-06 3:59
Maxwell Chen10-May-06 3:59 
GeneralRe: serializing data to memory. Pin
senthaaa10-May-06 20:29
senthaaa10-May-06 20:29 
QuestionHow can I make a dll in VC++? Pin
Orchid8510-May-06 2:59
Orchid8510-May-06 2:59 
AnswerRe: How can I make a dll in VC++? Pin
Hamid_RT10-May-06 3:03
Hamid_RT10-May-06 3:03 
GeneralRe: How can I make a dll in VC++? Pin
Orchid8510-May-06 3:06
Orchid8510-May-06 3:06 
AnswerRe: How can I make a dll in VC++? Pin
toxcct10-May-06 3:09
toxcct10-May-06 3:09 
GeneralRe: How can I make a dll in VC++? Pin
Orchid8510-May-06 3:16
Orchid8510-May-06 3:16 
AnswerRe: How can I make a dll in VC++? Pin
_AnsHUMAN_ 10-May-06 3:11
_AnsHUMAN_ 10-May-06 3:11 
GeneralRe: How can I make a dll in VC++? Pin
Orchid8510-May-06 3:18
Orchid8510-May-06 3:18 
JokeRe: How can I make a dll in VC++? Pin
Eytukan10-May-06 3:25
Eytukan10-May-06 3:25 
GeneralRe: How can I make a dll in VC++? Pin
toxcct10-May-06 3:41
toxcct10-May-06 3:41 
QuestionHow to implement EXCEL like autofilter in Grid control? Pin
kavitha Dass10-May-06 2:58
kavitha Dass10-May-06 2:58 
QuestionCreate ActiveX Control VC++.Net Pin
satsumatable10-May-06 2:36
satsumatable10-May-06 2:36 
AnswerRe: Create ActiveX Control VC++.Net Pin
_AnsHUMAN_ 10-May-06 2:58
_AnsHUMAN_ 10-May-06 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.