|
Hi,
I am currently trying to create a windows-based application in order to compile different projects !
To do so, the user need to select the project he wants to use, and I should then get the latest code from the SourceSafe database and compile it by using nmake in a Createprocess command.
But, unfortunately, when doing so, nkmake only create vc60.idb and vc60.pdd and nothing else.
I know nmake is working because when using it from a DOS windows, I could build my project by typing :
namke /f hfplayer.mak
Here is how I do use the createprocess :
PROCESS_INFORMATION ProcessInformation;
STARTUPINFO StartupInfo;
DWORD dwError;
BOOL bfProcess;
memset(&StartupInfo,0,sizeof(StartupInfo));
StartupInfo.cb = sizeof( StartupInfo );
StartupInfo.lpReserved = NULL;
StartupInfo.lpDesktop = NULL;
StartupInfo.lpTitle = NULL;
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_MAXIMIZE;
StartupInfo.cbReserved2 = 0;
StartupInfo.lpReserved2 = NULL;
memset(&ProcessInformation,0,sizeof(ProcessInformation));
char szCmdLine[256] ;
sprintf(szCmdLine,"nmake.exe /B HFPlayer.mak" ) ;
bfProcess = CreateProcess(NULL,szCmdLine,NULL,NULL,FALSE,0,NULL, "D:\\My Documents\\My Dev\\HFPlayer",&StartupInfo,&ProcessInformation );
Anyhelp would be welcome !
Thanks !
|
|
|
|
|
I have a CFrameWnd derived class which I called CFrameWndEx. If I implement MFC functions (default onclose, ondestroy etc) the class derived from mine works fine and they are used automatically in case i will not override them. (I am not so good in english but trying to explain at my best). But when I try to add my own functions , for example OnHelpSearch or something like that with my own command IDs(not default MFC ones like ID_APP_ABOUT) and also add theit updatecommandUI the class derived from mine does not handle them (I forgot to mention that my class is being comiled into lib so I use import) and menu items and etc. are disabled. How can I solve that ?
Kratz
|
|
|
|
|
I have a small library extending MFC classes usin MFC 4.2. But now C++.NET is coming. Can I compile with NET my lib to use MFC4.2 or 7.0 when needed or I should make 2 different versions of my library ?
Kratz
|
|
|
|
|
Question:
I wanna get a array of string, but I am not sure the dimension of the array.
like this:
int caller()
{
char **Results=new char*[100];
myfunc();
...
}
then
int myfunc(char ***Results)
{
char* resutl0 =(char*) malloc(100);
..
char* resutl1 =(char*) malloc(200);
...
char* resutl2 =(char*) malloc(300);
...
(*Result)[0] = resutl0 ;
(*Result)[1] = resutl1 ;
(*Result)[2] = resutl2 ;
...
}
after finished some code, i wanna free the memory. so, how can i do?
1.
free(result0);
free(result1);
free(result1);
free(Results);
??
2. GlobalFree(Results)
??
3 ??
Thanks.
Code is still code.
|
|
|
|
|
Your method 1 is the right one. By the way, it should be Result[0]=result0 , without your extra * .
If you can afford it, I suggest you forget about char ** s and use vector s and string s instead, like this:
std::vector<std::string> Results(100);
...
Results[0]="Hi dude";
... Automatic cleanup, no worries about getting your strings out of bounds, etc. Give it a try.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
How do i implement multiple views that use the same document in an SDI application
Thanks, Delvi
|
|
|
|
|
|
Thanks , I'll be sure to check them all out. There must be atleast one sample i can use!!
|
|
|
|
|
Hi,
In one dialog based application, i showed a bitmap image. Now i want to
change the rgb color of pixels in the special area. I hope that where the mouse
moved to where the color will be changed. Is it possible or not?
Would you please send me some code or ideas about how to control the mouse move and set the bitmap image window?
Thanks in Advance!
chen
|
|
|
|
|
Hi
Except Windows Time, there are only icons in the taskbar's status area. Sure, the only functions to access it seems to be Shell_NotifyIcon.
But is there a way to add small text or non standard width icon (i don't find any thread speakking about this) ?
Thanks for help.
|
|
|
|
|
I can Set the receive buffer size to 400k(use setsockopt())under Win2000.
but why can't under win98(getsockopt() return is 65280byte),How to solve!
Thanks very much!
|
|
|
|
|
I might be wrong but Win98 seems to have a lot of 64 KB restrictions. And this might be one of them.
Perhaps there is a workaround. But my guess is people would advise you to forget about 98.
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
Thanks for reply!
but it seemed that I may change the restriction with regedit!
Could you tell me!
|
|
|
|
|
Hello,
in my CFormView class, I want to draw something on the dc AFTER the controls are drawn.
Does someone know which method calls RedrawWindow or UpdateWindow (which call OnPaint())?
Thank you
Yann
|
|
|
|
|
I think this is not unique error message from my compiler but can some one tell me what is wrong when a message like this appears!?? HEEEELP!!
Compiling...
ReminderSEDlg.cpp
C:\Program\Microsoft Visual Studio\MyProjects\Reminder Special Edition\ReminderSEDlg.cpp(22) : error C2370: 'THIS_FILE' : redefinition; different storage class
c:\program\microsoft visual studio\myprojects\reminder special edition\configdlg.cpp(12) : see declaration of 'THIS_FILE'
Error executing cl.exe.
Reminder Special Edition.exe - 1 error(s), 0 warning(s)
------------------------------
CodeCracker - That's me!
------------------------------
|
|
|
|
|
It means the compiler has already found a definition fo THIS_FILE. Either it is defined in more than one place or you need to ifdef it out...
x.h
#ifndef x.h
// This will only be compiled once no matter how many times it is referenced.
#define x.h
#define THIS_FILE something
#endif
Thanks for the help,
Bill
|
|
|
|
|
It means the compiler has already found a definition fo THIS_FILE. Either it is defined in more than one place or you need to ifdef it out...
x.h
#ifndef x.h
// This will only be compiled once no matter how many times it is referenced.
#define x.h
#define THIS_FILE something
#endif
Hope this helps,
Bill
|
|
|
|
|
In addition to what Bill said, most of the code I deal has this little section near the top :
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif // _DEBUG
|
|
|
|
|
Hello,
I have created a dialog type app(called "A")and a dialog type wizard (Property Page type of wizard) (called "B") to be used with in dialog "A"..
I am having problems pulling string information from previous pages of the wizzard before the wizard dialog is destroyed. Im a newb to property pages, any ideas on how I can pull the string info that the user inputs into the wizard before its closed/finished?
Thanks,
Rob
|
|
|
|
|
Create member variables in your dialog class. Store the data you wish to access in the member variables. After the DoModal call returns, the dialog object still exists. You should be able to access its public members and methods just like any other object.
Hope this helps,
Bill
|
|
|
|
|
I have tried that with out success. I create the DoModal() wizard and when the OnFinish is returned I tried to pull the strings from the items on each dialog.. Maybe I need to add a OnKillActive and do UpdateData(FALSE) on each dialog?
I Have even tried to do a simple MessageBox on the destruction of the wizard and it's unable to pull the string info from the previous pages.. the MessageBox pops up blank.. I'll try to put the UpdateData(FALSE)function on each page OnKillActive..
If you have any other ideas please let me know.
Thanks,
Rob Jones
|
|
|
|
|
I've accomplished this in the past by creating a CStringArray variable in the page2, and filling that array while still on page1.
Maybe kinda bloated, but it worked.
Good Luck,
Frank
|
|
|
|
|
Your right, the data held in the dialogs that make up the wizard are no longer accessible. You should have a class that represents the wizard itself. This is the object whose DoModal method is executed. It is still accessible:
Here is a sample from a project I worked on last year. The first listing is the Wizard class itself. It is derived from CPropertySheet. The dialogs it presents are CPropertyPage derived objects. These are stored as member variables in the CWizard object.
Each of the property pages can access the CWizard class (as a parent window). While this one has no actual data stored in it, it could have. In this project, I have the individual property pages store data in project wide globals, so I didn't need to retrieve data from the Wizard itself.
#if !defined(AFX_WIZARD_H__14E36E7B_5840_11D4_BD9F_00B0D0209426__INCLUDED_)
#define AFX_WIZARD_H__14E36E7B_5840_11D4_BD9F_00B0D0209426__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Welcomeppg.h"
#include "Detectionppg.h"
#include "ComponentSelectionPpg.h"
#include "ComponentInstallationPpg.h"
#include "installCompletePpg.h"
#include "verifyppg.h"
class CWizard : public CPropertySheet
{
DECLARE_DYNAMIC(CWizard)
public:
CWizard(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
CWizard(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
public:
public:
CWelcomePpg m_ppgWelcome;
CDetectionPpg m_ppgDetection;
CComponentSelectionPpg m_ppgComponentSelection;
CComponentInstallationPpg m_ppgComponentInstallation;
CInstallCompletePpg m_ppgInstallComplete;
CVerifyPpg m_ppgVerify;
public:
virtual BOOL OnInitDialog();
virtual BOOL PreTranslateMessage(MSG* pMsg);
public:
virtual ~CWizard();
protected:
virtual void OnCancel();
DECLARE_MESSAGE_MAP()
};
#endif // !defined(AFX_WIZARD_H__14E36E7B_5840_11D4_BD9F_00B0D0209426__INCLUDED_)
|
|
|
|
|
Good idea!! I havent tried that yet, and it looks like it should work.
Thanks!
Rob
|
|
|
|
|
All of my wizard pages are derived from the CNewWizPage class so if I try to add a member variable ( Public: CItemDlg m_dItemDlg) inside of my CNewWizPage or CNewWizDialog class it errors... Maybe I should scrap the custom class and derive my own class from CPropertySheet instead.. This is the class I'm using "http://www.codeproject.com/dialog/wizard2000.asp" I dont know if you have tried it..
Just incase im doing something dumb here is what I did.. maybe I'm over looking something..
#if !defined(AFX_NEWWIZDIALOG_H__915D4C89_2E27_11D4_9FA9_0030DB0011C6__INCLUDED_)
#define AFX_NEWWIZDIALOG_H__915D4C89_2E27_11D4_9FA9_0030DB0011C6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ItemDlg.h"
class CNewWizPage;
class CNewWizDialog : public CDialog
{
public:
CNewWizDialog (LPCTSTR lpszTemplate, CWnd* pParent = NULL);
CNewWizDialog (UINT nIDTemplate, CWnd* pParent = NULL);
virtual ~CNewWizDialog ();
public:
protected:
CObList m_PageList;
UINT m_nPlaceholderID;
public:
CItemDlg m_dItemDlg;
void AddPage(CNewWizPage* pPage, UINT nID);
void SetActivePageByResource(UINT nResourceID);
BOOL SetFirstPage();
void SetNextPage();
void EnableFinish(BOOL bEnable);
void EnableBack(BOOL bEnable);
void EnableNext(BOOL bEnable);
int GetActiveIndex() const;
int GetPageIndex(CNewWizPage* pPage) const;
int GetPageCount();
CNewWizPage* GetPage(int nPage) const;
BOOL SetActivePage(int nPage);
BOOL SetActivePage(CNewWizPage* pPage);
void SetTitle(LPCTSTR lpszText);
void SetTitle(UINT nIDText);
void SetFinishText(LPCTSTR lpszText);
void SetFinishText(UINT nIDText);
protected:
BOOL ActivatePage(CNewWizPage* pPage);
BOOL DeactivatePage();
void SetPlaceholderID(int nPlaceholderID);
CNewWizPage* GetPageByResourceID(UINT nResourceID);
private:
void Init();
BOOL DestroyPage(CNewWizPage* pPage);
CNewWizPage* GetFirstPage();
CNewWizPage* GetLastPage();
CNewWizPage* GetActivePage() const;
CNewWizPage* GetNextPage();
protected:
virtual void DoDataExchange(CDataExchange* pDX);
virtual BOOL OnInitDialog();
protected:
afx_msg void OnDestroy();
afx_msg void OnWizardFinish();
afx_msg void OnWizardBack();
afx_msg void OnWizardNext();
afx_msg void OnCancel();
DECLARE_MESSAGE_MAP()
};
#endif // !defined(AFX_NEWWIZDIALOG_H__915D4C89_2E27_11D4_9FA9_0030DB0011C6__INCLUDED_)
Heres where it errors with an error of "e:\Wizard\itemdlg.h(22) : error C2065: 'IDD_ITEM' : undeclared identifier
e:\Wizard\itemdlg.h(22) : error C2057: expected constant expression"
class CItemDlg : public CNewWizPage
{
public:
CItemDlg(CWnd* pParent = NULL);
enum { IDD = IDD_ITEM }; <-- HERE
CString m_strPassword;
CString m_strVpassword;
CString m_strItem;
CString m_strName;
Any ideas?
Rob
|
|
|
|