Click here to Skip to main content
16,007,760 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: linked list with fast sorting Pin
6-Aug-01 4:08
suss6-Aug-01 4:08 
GeneralRe: linked list with fast sorting Pin
Malcolm McMahon6-Aug-01 5:09
Malcolm McMahon6-Aug-01 5:09 
GeneralRe: linked list with fast sorting Pin
7-Aug-01 1:09
suss7-Aug-01 1:09 
GeneralThread Client\Serveur Pin
4-Aug-01 4:16
suss4-Aug-01 4:16 
GeneralRe: Thread Client\Serveur Pin
4-Aug-01 4:19
suss4-Aug-01 4:19 
GeneralRe: Thread Client\Serveur Pin
Baafie4-Aug-01 14:29
Baafie4-Aug-01 14:29 
GeneralAutomating Project Creation Pin
Steve Thresher4-Aug-01 1:52
Steve Thresher4-Aug-01 1:52 
GeneralRe: Automating Project Creation Pin
Steve Thresher4-Aug-01 2:45
Steve Thresher4-Aug-01 2:45 
OK, I've managed to work out that the following code should create a test project:
#include "stdafx.h"

#include<stdio.h>

#include<atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
#include <initguid.h>
#include<comdef.h>

#include <ObjModel\appauto.h>
#include <ObjModel\appdefs.h>
#include <ObjModel\appguid.h>

#include <ObjModel\bldauto.h>
#include <ObjModel\bldguid.h>
#include <ObjModel\blddefs.h>

#include <ObjModel\textauto.h>
#include <ObjModel\textguid.h>
#include <ObjModel\textdefs.h>

#include <ObjModel\dbgauto.h>
#include <ObjModel\dbgguid.h>
#include <ObjModel\dbgdefs.h> 

IApplication *pApp;

int main(int argc, char* argv[])
{
  //Initialize COM libraries
  HRESULT hr = CoInitialize(NULL);
  if(FAILED(hr))
  {
    printf("Failed to initialize the COM libraries\n");
    return FALSE;
  }

  //Obtain the IApplication pointer
  hr = CoCreateInstance(CLSID_Application, NULL, CLSCTX_LOCAL_SERVER, IID_IApplication, (void**)&pApp);
  if(FAILED(hr))
  {
    printf("Failed to create an instance of MSDEV\n");
    CoUninitialize();
  }

  CComBSTR bProjectName("project");
  CComBSTR bPath("c:\\myproject");
  CComBSTR bType("Application");
  VARIANT_BOOL bCreateDirs=VARIANT_FALSE;
	
  // Create the project files
  pApp->AddProject(bProjectName,bPath,bType,bCreateDirs);

  //Quit from Visual C++
  pApp->Quit();
  pApp=NULL;

  //Uninitialize COM libraries
  CoUninitialize();

  return 0;
} 

The problem is the call to create the application is generating the following error:
Debug Error!

Program: test.exe
Module:
File: i386\chkesp.c
Line: 42

The value of ESP was not properly saved accros a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

Anbody got any ideas what the problem is?
GeneralRe: Automating Project Creation Pin
Steve Thresher4-Aug-01 2:48
Steve Thresher4-Aug-01 2:48 
GeneralScrolling a Bitmap in a CScrollView Pin
baywa4-Aug-01 1:13
baywa4-Aug-01 1:13 
GeneralCRichEditView::Stream() Pin
Frank Deo4-Aug-01 0:20
Frank Deo4-Aug-01 0:20 
GeneralRe: CRichEditView::Stream() Pin
Baafie4-Aug-01 2:59
Baafie4-Aug-01 2:59 
GeneralRe: CRichEditView::Stream() Pin
Frank Deo4-Aug-01 9:55
Frank Deo4-Aug-01 9:55 
GeneralRe: CRichEditView::Stream() Pin
4-Aug-01 12:46
suss4-Aug-01 12:46 
GeneralRe: CRichEditView::Stream() Pin
Frank Deo5-Aug-01 4:20
Frank Deo5-Aug-01 4:20 
Questionhow to Delete a class in visual c++? Pin
nemati3-Aug-01 21:28
nemati3-Aug-01 21:28 
AnswerRe: how to Delete a class in visual c++? Pin
Christian Graus4-Aug-01 2:40
protectorChristian Graus4-Aug-01 2:40 
GeneralRe: how to Delete a class in visual c++? Pin
Reno Tiko4-Aug-01 15:50
Reno Tiko4-Aug-01 15:50 
GeneralRe: how to Delete a class in visual c++? Pin
Christian Graus4-Aug-01 17:33
protectorChristian Graus4-Aug-01 17:33 
GeneralRe: how to Delete a class in visual c++? Pin
Reno Tiko6-Aug-01 19:36
Reno Tiko6-Aug-01 19:36 
AnswerRe: how to Delete a class in visual c++? Pin
4-Aug-01 21:15
suss4-Aug-01 21:15 
QuestionHow To Use Progress in visual c++? Pin
nemati3-Aug-01 21:26
nemati3-Aug-01 21:26 
AnswerRe: How To Use Progress in visual c++? Pin
Christian Graus4-Aug-01 2:41
protectorChristian Graus4-Aug-01 2:41 
GeneralHelp: CWindowDC and CBitmap Pin
Craig Miller3-Aug-01 20:55
Craig Miller3-Aug-01 20:55 
GeneralRe: Help: CWindowDC and CBitmap Pin
Paolo Messina5-Aug-01 6:15
professionalPaolo Messina5-Aug-01 6:15 

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.