|
thanks to all for replies.
only as i was checking through text afer posting did i notice mis-spelt header file. felt dumb.
found an example which showed me to locate enum and constants above struct in header, thats a relief.
now get errors:
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
Yahtzmain.cpp:
Error E2206 Yahtz.h 1: Illegal character 'ÿ' (0xff)
Error E2206 Yahtz.h 1: Illegal character 'þ' (0xfe)
Error E2040 Yahtz.h 1: Declaration terminated incorrectly
Error E2206 Yahtz.h 1: Illegal character '' (0x0)
Error E2206 Yahtz.h 1: Illegal character '' (0x0)
'' '' '' '' '' ''
(to bottom of screen)
Error E2228 Yahtz.h 13: Too many error or warning messages
*** 26 errors in Compile ***
new header file is:
/* header file */
#ifndef YATZ_H
#define YATZ_H
const int ScoreMax=17;
const int DiceMax=5;
enum ScoreCat {Ones,Twos,Threes,Fours,Fives,Sixes,
Three_of_a_Kind,Four_of_a_Kind,Full_House,
Small_Straight,Large_Straight, Yahtzee, Chance,
Bonus, Upper_Total, Lower_Total,Grand_Total};
struct Play
{
private:
public:
int Score[ScoreMax+1];
int Dice[DiceMax+1];
void DisplayScoreCat(ScoreCat Cat);
void DisplayDice();
void Throw();
void Initialise();
};
#endif
/* ****************************** */
error mesages from borland 4.5 for same code :
Linking yahtzee.exe:
linker Warning: No module definition file specified: using defaults
Linker Error: Play::DisplayScoreCat(ScoreCat) defined in module YAHTZMAIN.CPP is duplicated in module YAHTZ.CPP
/* **************** */
these 5 linker messages continue for all functions.
i am giving up and getting on with conceptual foundations study.
thanks again
kirk
|
|
|
|
|
Hi !
I am facing a problem which I don't know if a solution exists. I might have to develop a software which should fullfill these requirements :
- Modular
- Using an Oracle database
- Have to work on Windows and Linux
I know that Oracle exists for both OS. I don't exactly know how to interface it in a way that will work for both Windows and Linux.
But my main concern is regarding modularity. Each time I had to have modularity under Windows, I just used ActiveX components. I was easy and worked well.
But, how to achieve such modularity on Linux ? Is it possible to have a concept of modularity which would work for both Windows and Linux ?
Any hints, help, links, advice, etc.. will be greatly appreciated !
Jerome
|
|
|
|
|
There is (almost) certainly no single framework for you to work with, and the resulting code compiles on Linux and Windows.
To make a GUI that works with Linux and Windows use Java, or you can try wxWindows[^]. It works fine, but is not as advanced as MFC.
*modified the link. 2003-0211T12:37:00*
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
|
Yes, thanks!
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
ODBC interface to databases is available both on Linux and Windows. I guess Oracle has some lower-level API that might also work on both systems.
There's an implementation of DCOM for Linux from Software AG.
|
|
|
|
|
You can alos check out the QT-Framework wihich is a very well developed C++-cross-platform GUI-library with database connectivity included. It is free and open-source for Linux non-commercial usage, for Windows there is a time-limited test release, I think. www.trolltech.com or www.troll.no or www.trolltech.no
|
|
|
|
|
Help
I have a Problem and i don't now how to solve it. I wont to Comunicate with a FX2N SPS seriel RS232. Do enyone now how can i do this?
a links oder some (code) will help me.
Thanks Dasa
|
|
|
|
|
I wrote following code for creating toolbar
CToolbar x;
if(!x.Create(this, WS_CHILD | WS_VISIBLE | CBRS_TOOLTIPS |CBRS_TOP|CBRS_SIZE_FIXED|CBRS_ALIGN_TOP| CBRS_GRIPPER,ID_TOOLBAR_MEASURE))
{RACE0("Failed to create toolbar\n");return ; // fail to create }
CToolBarCtrl *m_pToolBarCtrl = &x.GetToolBarCtrl();
TBBUTTON tbb[6]={.............};
m_pToolBarCtrl->AddButtons(76, tbb) ;
m_pToolBarCtrl->SetRows(2,TRUE,&r);
If the program run in DEBUG mode I am getting Exact out put
But I change project setting from DEBUG to RELEASE
I was observered following changes in the structre of the toolbar
1.Some times Total Toolbar occupying the whole window
2.Without have any buttons
3.Some times only single row
Please Help me
|
|
|
|
|
Hi,
I've succeeded in writing my own DDX and DDV routines.
After implementing the ExtraDDX stuff in my project's clw file,
I now want to make these routines available to all my future
projects by putting it in ddx.clw as suggested in Technical Note 26 !
I've already tried the following directories ...
c:\program files\microsoft visual studio\common\msdev98\bin<br />
c:\program files\microsoft visual studio\vc98\bin<br />
c:\program files\microsoft visual studio\vintdev98\bin
But no success so far
The content of my ddx.clw file is ...
[ExtraDDX]<br />
ExtraDDXCount=5<br />
ExtraDDX1=E;;AC Value;BYTE;0;ACText;AC BYTE with range verification;ACMinMaxByte;Mi&nimum;u;Ma&ximum;u<br />
ExtraDDX2=E;;AC Value;short;0;ACText;AC Short with range verification;ACMinMaxShort;Mi&nimum;d;Ma&ximum;d<br />
ExtraDDX3=E;;AC Value;UCOUNT;0;ACText;AC Unsigned short with range verification;ACMinMaxUshort;Mi&nimum;u;Ma&ximum;u<br />
ExtraDDX4=E;;AC Value;int;0;ACText;AC Integer with range verification;ACMinMaxInt;Mi&nimum;d;Ma&ximum;d<br />
ExtraDDX5=E;;AC Value;UINT;0;ACText;AC Unsigned integer with range verification;ACMinMaxUint;Mi&nimum;u;Ma&ximum;u
Can anyone please tell me where to put it or is it just not possible with VC++ 6.0 ?
Thanks ...Sven
|
|
|
|
|
hi my name is an, jaeho.
my problem is below....
a = 1111111...1111/0000...00000 (high/low) each other 32bit.
__int64 a;
printf(" integer output : %d ", a);
result GUI
integer output : 0
----------------------------------
i want to perfectely 64bit print....
plese give me advice!!
|
|
|
|
|
use:
printf(" integer output : %I64d ", a);
Steve
|
|
|
|
|
Hi everyone,
I need help and suggestion with something I will program soon.
Look this post for explanation.
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&mode=all&userid=128795&select=406290&df=100#xx406290xx
Thanx !
Progamming looks like taking drugs...
I think I did an overdose.
|
|
|
|
|
Hi Guys,
I'm trying to create a standalone dialog without a parent window, is this possible? I tried:
hWnd = CreateDialog(hInstance,
MAKEINTRESOURCE(IDD_MAIN_DIALOG ),
hBigWnd, (DLGPROC) dlgProc);
But GetLastError() gives me "Invalid window handle".
how do I solve this problem?
thanks
|
|
|
|
|
I want to Create a Process with CreateProcessAsUser from as PrintMonitor running under the System Account
Hello,
I want start a application from a Portmonitor after finisch the Print of the document. Currently i start the application with createprocess but the application running under the system account and has no access to the My Files Directory and the MAPI interface and so on, only acces to the Files or Directorys with "Allow All" access rights.
I need to start the application with the rigths from the logged on user.
i have found many sample and notes with create user but i must given them a user account name and passwort with domain but i will to start the application on the desktop of the logged on user with the rights of this user. the samples i have found to do this without given of a username, password do not work.
This Portmonitor is a part of a Printerdriver you can easy print on in and it make a pdf for you to save or mail it. If the PDF System finished it will be distributed under the GPL.
The Printerdriver, Portmonitor and Application working fine but the problem with the rights under system account is open.
Thanks for help me.
Sorry for bad english.
|
|
|
|
|
Is there a simple way to detect if its the first time an app is being run ? i want to display a license agreement without an installer program, my app is dialog based, if it matters.
Cheers
|
|
|
|
|
Typically I have apps that create either registry or an ini entry. So I just detect whether this has occurred. Another way would be for your app to create or delete a dummy file in the program's own directory.
Another way would be to compare the time the app is downloaded to the time of the running. But this would be quite imprecise.
I don't think their is any API IsFirstRun() function in the system.
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
I'm guessing the concept of a 2 hour movie showing two guys eating a meal and talking struck them as 'foreign'
Rob Manderson wrote:
|
|
|
|
|
I need to replace the WinMain implemented in MFC, by my own WinMain to encapsulate MFC initialization within the win32 service entry point function.
Does anybody got any clue?
/regards/
|
|
|
|
|
You need to tell the linker to use your WinMain version, which is done via the "Entry-point symbol" box inside Project Settings/Link/Output category.
That's the extent of my knowledge, since I've personally never done this. Take a look at "entry point" in the MSDN.
Another approach is to create a dummy Console project and add MFC support to it. There you can get the code for initializing the MFC libraries. You can then create a regular "Win32 Application" and copy that code there.
Regards,
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|
|
Thank you Alvaro!
I've changed the type of linked application and included the _tmain() function and MFC initialization code from MFC library. It looks like this: <see below="">
Application starts normally, but it throws the access violation exception while destroying the application document. Wonder why.
Anyway I'll try to change the entry point from linker options.
TServiceApp Service(ServiceStart, ServiceStop); // application service object
int _tmain(int argc, const TCHAR* argv[], TCHAR* envp[])
{
int RetCode = 1;
// if(AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
Service.ServiceName = NETACCESS_SERVICENAME;
Service.DisplayName = NETACCESS_DISPLAYNAME;
Service.Initialize(argc, argv);
RetCode = Service.Status.ExitCode;
}
// else
// WriteServiceLog(_T("Fatal Error: MFC initialization failed.\n"));
return RetCode;
}
DWORD __fastcall ServiceStart(DWORD Count, LPTSTR *lpszArgv)
{
Service.Status.Report(SERVICE_START_PENDING); // 3000
STARTUPINFO StartupInfo;
StartupInfo.dwFlags = 0;
GetStartupInfo(&StartupInfo);
HINSTANCE hInstance = GetModuleHandle(NULL);
HINSTANCE hPrevInstance = NULL;
LPTSTR lpCmdLine = GetCommandLine();
int nCmdShow = SW_SHOWDEFAULT;
if(StartupInfo.dwFlags & STARTF_USESHOWWINDOW)
nCmdShow = StartupInfo.wShowWindow;
Service.Status.ExitCode = -1;
CWinThread* pThread = AfxGetThread();
CWinApp* pApp = AfxGetApp();
// AFX internal initialization
if (!AfxWinInit(hInstance, hPrevInstance, lpCmdLine, nCmdShow))
goto InitFailure;
// App global initializations (rare)
if(pApp != NULL && !pApp->InitApplication())
goto InitFailure;
// Perform specific initializations
if(!pThread->InitInstance())
{
if (pThread->m_pMainWnd != NULL)
{
TRACE(traceAppMsg, 0, "Warning: Destroying non-NULL m_pMainWnd\n");
pThread->m_pMainWnd->DestroyWindow();
}
Service.Status.ExitCode = pThread->ExitInstance();
goto InitFailure;
}
Service.Status.Report(SERVICE_RUNNING); // 0
Service.Status.ExitCode = pThread->Run();
InitFailure:
#ifdef _DEBUG
// Check for missing AfxLockTempMap calls
if (AfxGetModuleThreadState()->m_nTempMapLock != 0)
{
TRACE(traceAppMsg, 0, "Warning: Temp map lock count non-zero (%ld).\n",
AfxGetModuleThreadState()->m_nTempMapLock);
}
AfxLockTempMaps();
AfxUnlockTempMaps(-1);
#endif
AfxWinTerm();
return Service.Status.ExitCode;
}
VOID __stdcall TServiceApp::Initialize(DWORD Count, LPCTSTR *Args)
{
if(mServiceStart && mServiceStop)
{
SERVICE_TABLE_ENTRY DispatchTable[] =
{
{ mServiceName, TServiceApp::ServiceMain },
{ NULL, NULL }
};
if(Count > 1 && (*Args[1] == '-' || *Args[1] == '/'))
{
TCoreService Service;
TServiceManager Manager;
Service.Name = mServiceName;
Service.DisplayName = mDisplayName;
Service.Dependencies = mDependencies;
if(_stricmp(_T("install"), Args[1] + 1) == 0)
{
Manager.Install(&Service);
Service.__Start(Count, Args);
}
else
if(_stricmp(_T("remove"), Args[1] + 1) == 0)
Manager.Remove(&Service);
else
if(_stricmp(_T("debug"), Args[1] + 1) == 0)
{
TServiceHandle::sDebug = TRUE;
WriteServiceLog(_T("Debugging %s.\n"), mDisplayName);
SetConsoleCtrlHandler(ControlHandler, TRUE);
if(mServiceStart)
mServiceStart(Count, (LPTSTR*)Args);
}
else
goto Dispatch;
}
else
Dispatch:
if(!TCoreService::__StartCtrlDispatcher(DispatchTable))
WriteMessage(_T("Initialize: Failed to start service control dispatcher."));
}
else
WriteServiceLog(_T("Initialize: Start and stop routines must be specified.\n"));
}
/regards/
|
|
|
|
|
|
if you switch from statically-linked MFC to dynamically-linked MFC, you'll see the difference MFC makes.
just using enough MFC to use CDialog and CString will add over to 200K to my ATL objects.
-c
WWT2D?
|
|
|
|
|
|
Thomas George wrote:
my exe size went up from 680 KB to 1MB
the static libs my company sells nearly tripled in size with VC7. i talked with MS reps about this and they told me it was due to increased 'locale' support in the latest STL & C++ std libs.
-c
Be very, very careful what you put into that head, because you will never, ever get it out. --Thomas Cardinal Wolsey
|
|
|
|
|
Thomas George wrote:
Is there any tool to do an analysis of what constitutes an exe? like how much is MFC, how much is my actual code etc?
dumpbin.exe is surely a good start.
|
|
|
|