|
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.
|
|
|
|
|
Generate a MAP file and then have a look at that. This list every function, class etc. and there address. So you can calc the size of functions as well if you want.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Hiya have just started to learn SQL and am having trouble with the INSERT and DELETE and EXECUTESQL statements. Can someone show me how to use these functions?? have tried but keep getting it wrong.
What I really need is a example program with some SQL statements being used.
I am using CDatabase and CRecordset for the database.
Thanks for your help.
grahamoj.
|
|
|
|
|
hi,
CDatabase m_db; //declare database object
CRecordset m_EmpTable; // declare recordset for employee table
//////////////////////////////////////////////////////////////////////////////
// Open connection to database ORACLE01 (must be defined as
// data source in ODBC)
TRY{
m_db.OpenEx( "DSN=ORACLE01;UID=scott;PWD=tiger" , CDatabase::noOdbcDialog );
}
CATCH( CDBException, dbe ){
MessageBox( dbe->m_strError );
}
END_CATCH
//////////////////////////////////////////////////////////////////////////////
// Insert new employee record into table Emp
TRY{
m_db.ExecuteSQL( "INSERT INTO EMP VALUES(10, 'John','Brown','Chicago')" );
}
CATCH( CDBException, dbe ){
MessageBox( dbe->m_strError );
}
END_CATCH
//////////////////////////////////////////////////////////////////////////////
// Retrieve records from table Emp based on query
CString id;
CString fname;
CString lname;
CString city;
m_EmpTable.Open( CRecordset::dynaset, "SELECT * FROM EMP" ); // open recordset
while( !m_EmpTable.IsEOF( ) ) // retrieve records one by one
{
m_EmpTable.GetFieldValue( (int)0, id );
m_EmpTable.GetFieldValue( 1, fname);
m_EmpTable.GetFieldValue( 2, lname );
m_EmpTable.GetFieldValue( 3, city );
// do something with data
m_EmpTable.MoveNext(); // move to the next record
}
or you can do it like this..
CAccountRecord rs(&db);
rs.Open( CRecordset::snapshot );
rs.AddNew();
rs.m_NAME = "Becky Dugan";
rs.m_ADDRESS = "Bustins, ME 01443";
rs.m_ID = 33;
rs.m_AMOUNT = 100000;
if(!rs.Update( )){
cout << "Record not added; no field values were set.";
return FALSE;
}
rs.Close();
m_EmpTable.Close(); // close recordset
// How to do an UPDATE
/////////////////////////////////////////////////////////
rs.Open( CRecordset::snapshot,
_T( "select * from scott.account where id=42" ));
rs.MoveFirst();
rs.Edit();
rs.m_NAME = "Robert Dugan";
if(!rs.Update( )){
cout << "Update failed." << endl;
return FALSE;
}
rs.Close();
Verify that the update happened by using sqlplus:
// How to do a DELETE
////////////////////////////////////////////////////////
rs.Open( CRecordset::snapshot );
rs.MoveLast();
rs.Delete();
rs.Close();
i hope this is done now..Cheers
Himanshu
|
|
|
|
|
Hey all. I'm having some trouble figuring out askey. How would I cycle through a file to find out how many of each letter there is, and how many spaces, periods, etc. I know each letter has a number value, but how do I convert it? Also, how would I make a vector that has a slot for each letter in the alphabet increase by 1 every time a letter is found that corrosponds to that slot in the vector?
Hopefully you understood my question .
Thanks in advance.
|
|
|
|
|
proprogram wrote:
Hey all. I'm having some trouble figuring out askey.
I haven't got a clue what "askey" is. My best guess it that you heard someone say it - in case it's spelled ASCII (American Standard Code for Information Interchange).
What you want to do is find the frequency of characters in a given file, and you are on the right track with the question:
how would I make a vector that has a slot for each letter in the alphabet increase by 1 every time a letter is found that corrosponds to that slot in the vector?
You first create a vector, or even an array since you know in advance that you'll only have to deal with at most 256 different values. Let's use the shortest code and use an array:
// The following line creates an array of 256
// unsigned integers, initializing all of them to zero.
unsigned int freq[256] = { 0 };
// 1.
// Here you are supposed to read through your file,
// one byte at a time, and put the read [unsigned char]
// value into a variable. Let's call it foo.
unsigned char foo = read_next_byte();
// 2.
// The following line uses the character value
// (if in a particular range also called the ASCII code)
// as an index into the array. Let's tell it we've found
// another character/byte with this value.
// Note that for a closed set like this (0-255), the
// index itself is actually also a data carrier.
// This can be worth recognising for further adventures
// into computing algorithms.
++freq[foo];
// Jump back to 1 until the file/stream is exhausted.
Now you can do whatever you like with your array.
++luck;
|
|
|
|