Click here to Skip to main content
16,006,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: AdjustWindowRect problems Pin
Peter Andersson6-Aug-01 3:34
Peter Andersson6-Aug-01 3:34 
GeneralAutomating Visual C++ Project Creation Pin
Steve Thresher6-Aug-01 1:34
Steve Thresher6-Aug-01 1:34 
GeneralRe: Automating Visual C++ Project Creation Pin
J Patel6-Aug-01 11:10
J Patel6-Aug-01 11:10 
GeneralRe: Automating Visual C++ Project Creation Pin
Steve Thresher6-Aug-01 23:09
Steve Thresher6-Aug-01 23:09 
GeneralRe: Automating Visual C++ Project Creation Pin
Tim Deveaux6-Aug-01 12:38
Tim Deveaux6-Aug-01 12:38 
GeneralRe: Automating Visual C++ Project Creation Pin
Steve Thresher6-Aug-01 23:06
Steve Thresher6-Aug-01 23:06 
GeneralRe: Automating Visual C++ Project Creation Pin
Nick Van den Abbeele7-Aug-01 0:51
Nick Van den Abbeele7-Aug-01 0:51 
GeneralRe: Automating Visual C++ Project Creation Pin
Tim Deveaux7-Aug-01 9:34
Tim Deveaux7-Aug-01 9:34 
Ah! Good idea - actually, article Q247035 discusses both methods, but neither seems at first glance what I would call elegant.

Using #import, this is about the simplest I could come up with - please excuse the strange err handling...

// VCImportTest.cpp : Defines the entry point for the console application.
//
 
#include "stdafx.h"          // optional
#include <atlbase.h>
#import "devshl.dll"
 
using namespace DSSharedObjects;  // optional
 
int main(int argc, char* argv[])
{
    HRESULT hr = CoInitialize(NULL);
    if(FAILED(hr)) {
        _asm int 3;
    }
 
    DSSharedObjects::IApplicationPtr pIApp;
     
    hr = pIApp.CreateInstance("MSDEV.Application");
    if(FAILED(hr)){
        _asm int 3;
    }
 
    _bstr_t bstrProjName("myproject");
    _bstr_t bstrPath("e:\\project\\myproject");
    _bstr_t bstrType("Application");
    VARIANT_BOOL bCreateDirs = VARIANT_TRUE;
    
 
    hr = pIApp->AddProject(bstrProjName, bstrPath, bstrType, bCreateDirs);
    if(FAILED(hr)) {
        _asm int 3;
    }
 
    pIApp->Quit();
 
    return 0;
}


But it looks to me like this automation will be obsolete with VS.NET - I just started looking at beta 2 and there are no ObjModel headers, and no devshl.dll.
GeneralRe: Automating Visual C++ Project Creation Pin
Steve Thresher7-Aug-01 22:31
Steve Thresher7-Aug-01 22:31 
GeneralLine style and color Pin
6-Aug-01 1:26
suss6-Aug-01 1:26 
GeneralRe: Line style and color Pin
Not Active6-Aug-01 3:11
mentorNot Active6-Aug-01 3:11 
GeneralCAsyncSocket Pin
6-Aug-01 0:38
suss6-Aug-01 0:38 
GeneralMulti Document Interface question Pin
Ashman6-Aug-01 0:22
Ashman6-Aug-01 0:22 
GeneralRe: Multi Document Interface question Pin
Not Active6-Aug-01 3:13
mentorNot Active6-Aug-01 3:13 
GeneralVirus Scanners Pin
Steve Thresher6-Aug-01 0:00
Steve Thresher6-Aug-01 0:00 
Generalmfc windows explorer insantiy Pin
karmatosed5-Aug-01 23:56
karmatosed5-Aug-01 23:56 
QuestionHow can i .. Pin
5-Aug-01 23:55
suss5-Aug-01 23:55 
Generaldebug error Pin
Gérald Mercet5-Aug-01 23:51
Gérald Mercet5-Aug-01 23:51 
GeneralRe: debug error Pin
6-Aug-01 6:32
suss6-Aug-01 6:32 
GeneralGetting from CDocument to frame Pin
Malcolm McMahon5-Aug-01 22:27
Malcolm McMahon5-Aug-01 22:27 
GeneralRe: Getting from CDocument to frame Pin
#realJSOP6-Aug-01 1:30
professional#realJSOP6-Aug-01 1:30 
GeneralRemoving ActiveX of resource !!! Pin
Hadi Rezaee5-Aug-01 20:16
Hadi Rezaee5-Aug-01 20:16 
GeneralRe: Removing ActiveX of resource !!! Pin
Baafie6-Aug-01 4:06
Baafie6-Aug-01 4:06 
GeneralDatabase questions ... Pin
Hadi Rezaee5-Aug-01 20:06
Hadi Rezaee5-Aug-01 20:06 
GeneralSet Text/Background colour of control in WTL Pin
Christian Graus5-Aug-01 18:37
protectorChristian Graus5-Aug-01 18:37 

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.