Click here to Skip to main content
15,902,299 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSetting Threading Model in ActiveX control using VC++ Pin
AbbyIndian12-Feb-07 23:24
AbbyIndian12-Feb-07 23:24 
AnswerRe: Setting Threading Model in ActiveX control using VC++ Pin
Hamid_RT12-Feb-07 23:41
Hamid_RT12-Feb-07 23:41 
AnswerRe: Setting Threading Model in ActiveX control using VC++ Pin
toxcct13-Feb-07 0:10
toxcct13-Feb-07 0:10 
GeneralRe: Setting Threading Model in ActiveX control using VC++ Pin
AbbyIndian13-Feb-07 0:23
AbbyIndian13-Feb-07 0:23 
AnswerRe: Setting Threading Model in ActiveX control using VC++ Pin
Mark Salsbery13-Feb-07 7:15
Mark Salsbery13-Feb-07 7:15 
GeneralRe: Setting Threading Model in ActiveX control using VC++ Pin
AbbyIndian13-Feb-07 22:45
AbbyIndian13-Feb-07 22:45 
GeneralRe: Setting Threading Model in ActiveX control using VC++ Pin
Mark Salsbery14-Feb-07 5:46
Mark Salsbery14-Feb-07 5:46 
GeneralRe: Setting Threading Model in ActiveX control using VC++ Pin
Mark Salsbery14-Feb-07 5:51
Mark Salsbery14-Feb-07 5:51 
AbbyIndian wrote:
Also, if the threading model is changed directly in the Registry..it works...n I can do the same using VC++ code...but I want to know where is the free threading model constant


Here's the (I think) relevant code from MFC (the pstrThreadingModel value you want is szBoth
which is defined as "static TCHAR szBoth[] = _T("Both");"):
if (nRegFlags & afxRegApartmentThreading)
    pstrThreadingModel = szApartment;

if (nRegFlags & afxRegFreeThreading)
    pstrThreadingModel = szFree;

if ((nRegFlags & (afxRegFreeThreading | afxRegApartmentThreading)) ==
        (afxRegFreeThreading | afxRegApartmentThreading))
{
    pstrThreadingModel = szBoth;
}

if (pstrThreadingModel != NULL)
{
    HKEY hkeyInprocServer32;
    bSuccess = (::RegOpenKeyEx(hkeyClassID, _T("InprocServer32"), 0, KEY_WRITE,
        &hkeyInprocServer32) == ERROR_SUCCESS);
    if (!bSuccess)
        goto Error;
    ASSERT(hkeyInprocServer32 != NULL);
    bSuccess = (::RegSetValueEx(hkeyInprocServer32, _T("ThreadingModel"), 0,
        REG_SZ, (const BYTE*) pstrThreadingModel,
        (lstrlen(pstrThreadingModel)+1) * sizeof(TCHAR)) == ERROR_SUCCESS);
    ::RegCloseKey(hkeyInprocServer32);
}

GeneralRe: Setting Threading Model in ActiveX control using VC++ Pin
AbbyIndian14-Feb-07 7:42
AbbyIndian14-Feb-07 7:42 
QuestionCan any one tell me abt Multi-threading Pin
himuskanhere12-Feb-07 23:09
himuskanhere12-Feb-07 23:09 
AnswerRe: Can any one tell me abt Multi-threading Pin
Hamid_RT12-Feb-07 23:15
Hamid_RT12-Feb-07 23:15 
AnswerRe: Can any one tell me abt Multi-threading Pin
_AnsHUMAN_ 12-Feb-07 23:17
_AnsHUMAN_ 12-Feb-07 23:17 
AnswerRe: Can any one tell me abt Multi-threading Pin
Hamid_RT13-Feb-07 18:27
Hamid_RT13-Feb-07 18:27 
Questionhow to create compatible plug-in for windows media player & real player using vc++? [modified] Pin
A.Venkata ramana12-Feb-07 23:04
A.Venkata ramana12-Feb-07 23:04 
AnswerRe: how to create compatible plug-in for windows media player & real player using vc++? Pin
Hamid_RT12-Feb-07 23:25
Hamid_RT12-Feb-07 23:25 
QuestionEnumerating hardware ( again ) Pin
Waldermort12-Feb-07 23:03
Waldermort12-Feb-07 23:03 
Questionmenu [modified] Pin
Anilkumar K V12-Feb-07 22:18
Anilkumar K V12-Feb-07 22:18 
AnswerRe: menu Pin
toxcct12-Feb-07 22:24
toxcct12-Feb-07 22:24 
GeneralRe: menu Pin
Anilkumar K V12-Feb-07 22:33
Anilkumar K V12-Feb-07 22:33 
GeneralRe: menu Pin
jhwurmbach12-Feb-07 22:59
jhwurmbach12-Feb-07 22:59 
GeneralRe: menu Pin
Anilkumar K V12-Feb-07 23:24
Anilkumar K V12-Feb-07 23:24 
GeneralRe: menu Pin
toxcct12-Feb-07 23:26
toxcct12-Feb-07 23:26 
GeneralRe: menu Pin
jhwurmbach12-Feb-07 23:32
jhwurmbach12-Feb-07 23:32 
QuestionAbout a function??? Pin
siddharthsan12-Feb-07 22:09
siddharthsan12-Feb-07 22:09 
AnswerRe: About a function??? Pin
toxcct12-Feb-07 22:13
toxcct12-Feb-07 22:13 

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.