|
S Douglas wrote: when you go to distribute your apps you will need to ship the updated C runtime Microsoft Visual C++ 2005 Redistributable Package (x86)[^] for older computers
Which is 2,5 MB in size, only needed once per Computer, plus you can use the link to Microsoft (and don't have to ship it yourself).
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
You will only need to do that if you link dynamically to MFC / CRT. If you link statically (not the default settings, by the way), you don't have to distribute anything but your exe.
|
|
|
|
|
Hi
Where is the data serialized in a activeX Control file or registery? Can we access that data?
Regards
The Best Religion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hi all,
I am using an ODBC class written by Carlos Antollini (A set of ODBC Classes) and making use of Oracle 10g Express Edition.
Basically what I'm trying to do, is perform a select statement on the database to determine if a certain
record exists. If the record exists I perform an UPDATE stament, and when the record doesn't exists,
I perform a INSERT. (I don't want to go the route of the Stored Procedures Thanks )
For instance:
pdb.m_nRowsAffected=0;
pdb.Execute(SELECT * FROM TABLE WHERE FIELDNAME = 'CONDITION';);
if (pdb.m_nRowsAffected>0)
{
UPDATE
}
else
{
INSERT
}
THE PROBLEM:
The variable m_nRowsAffected returns a code of -1, even if the record exists. After stepping into the
function I saw that the SQLRowCount sets the variable to -1. I have no idea what is going on . If I make
use of MySQL everything works. An example of the function Execute() is shown below. Can anyone please
assist me in this problem??
BOOL CODBCDatabase::Execute(CHAR *szSqlStr)
{
SQLRETURN ret;
SQLHSTMT hStmt = NULL;
SQLINTEGER nRowCount;
SQLAllocHandle(SQL_HANDLE_STMT, m_hDbc, &hStmt);
ret = SQLExecDirect(hStmt, (SQLCHAR*)szSqlStr, SQL_NTS);
SQLRowCount(hStmt, &nRowCount);
m_nRowsAffected = nRowCount;
return ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO;
}
Many Thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
It's not really my topic but I did once write a SQL parser prototype based on the Oracle 8 SQL spec only to find that Oracle 8 SQL and 'normal' SQL disagree about a lot of things, especially SELECT cleverness. I'd check your Oracle docs for how to do this their way. I don't know if 10 is any more standards compliant than 8. Can you see what SQL the ODBC driver is producing and compare the MySQL output with the Oracle by any chance. That might help.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Well, I believe that doing a SELECT * is less optimal that doing a SELECT 1 because less data has to be processed/returned if you are just testing for the existance of something. That aside, I would try using SELECT 1 and maybe even an EXISTS test to return a rowset:
SELECT 1 FROM TABLE WHERE FIELDNAME = 'CONDITION'
SELECT 1 FROM TABLE WHERE EXISTS( SELECT * FROM TABLE WHERE FIELDNAME = 'CONDITION' ) I have had the unfortunate experience of working with multiple RDBMSes and you sometimes have to do something obscure like the above in order to make things works everywhere. If even the above calls fail, try executing the query within an EXEC statement (this is a problem I have had with Sybase RDBMSes).
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi James,
Thanks for the reply, I'll try it and see what I can do.
Many Thanks
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Can anybody help me in solving my problem.....
i am using a CFileDialog class for accessing multiple files through browse.But depending up on the file path length the number of files that are getting selected varied
Is there anyway in solving this problem(i need to select a maximum of 20 files).
CFileDialog fileDialog(true,null,null,OFN_MULTISELECT | OFN_NODEREFERNCELINK |OFN_EXPLORER ,"Excel File(*.xls)|*.xls|AllTypes(*.*)|*.*");
||SnAkeBed||
|
|
|
|
|
I htink you need to change the buffer size used for the returned filenames if the OFM struct:
It has to be large enough to contain all the full paths etc for all the files selected.
So you probably need _MAX_PATH * 20 in length:
<br />
char buffer[4096] = "";
dlg.m_ofn.nMaxFile = 4096;<br />
dlg.m_ofn.lpstrFile = buffer;<br />
If you vote me down, my score will only get lower
|
|
|
|
|
i tried that its generating error...
this is my exact code
obBrowse()
{
int count=0;
CSting filename[256];
CFileDialog fileDialog(true,null,null,OFN_MULTISELECT | OFN_NODEREFERNCELINK|OFN_EXPLORER ,"Excel File(*.xls)|*.xls|AllTypes(*.*)|*.*");
POSITION file=fileDialog.GetStartPosition();
if(fileDialog.DoModal==IDOK) //this is where error is generating if i select more files... (for example 20)
{
UINT count=0;
POSITION pos=fileDialog.GetStartPosition();
while(pos)
{
fileDialog.GetNextPathPosition(pos);
++count;
}
while(file!=NULL)
{
fileName[count]=fileDialog.GetNextPathName(file);
}
}
}
can you tell me where
||SnAkeBed||
|
|
|
|
|
SnaKeBeD wrote: if(fileDialog.DoModal==IDOK)
How did you even get this to compile correctly, or is it not a true copy/paste?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
SnaKeBeD wrote: CFileDialog fileDialog(true,null,null,OFN_MULTISELECT | OFN_NODEREFERNCELINK|OFN_EXPLORER ,"Excel File(*.xls)|*.xls|AllTypes(*.*)|*.*");
POSITION file=fileDialog.GetStartPosition();
mmmm...is it too soon to call GetStartPosition() ?
Russell
|
|
|
|
|
SnaKeBeD wrote: if(fileDialog.DoModal==IDOK)
what about
if(fileDialog.DoModal()==IDOK)
Russell
|
|
|
|
|
I use this code:
CFileDialog dlgFile(TRUE, "txt", NULL, OFN_HIDEREADONLY|OFN_FILEMUSTEXIST|OFN_ALLOWMULTISELECT, YOURFILETYPEFILTER, NULL, 0);<br />
CString ResourceString="Select file(s)";<br />
TCHAR szFile[IMPORT_MAX_PATH_LENGTH];<br />
_tcscpy(szFile, ResourceString);<br />
dlgFile.m_ofn.lpstrFile=szFile;<br />
dlgFile.m_ofn.nMaxFile=IMPORT_MAX_PATH_LENGTH;<br />
if(dlgFile.DoModal()!=IDOK) return FALSE;
Russell
|
|
|
|
|
_Russell_ wrote: CString ResourceString="Select file(s)";
TCHAR szFile[IMPORT_MAX_PATH_LENGTH];
_tcscpy(szFile, ResourceString);
you could have factorized this anyway :
TCHAR szFile[IMPORT_MAX_PATH_LENGTH] = _T("Select file(s)");
|
|
|
|
|
|
|
I am trying to get OLE drag and drop to work in one of my applications. According to all the documentation I can find the minimum I need to be able to drag an object from my app into a OLE drag target would be:
<br />
HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE,20);<br />
if (hData != NULL)<br />
{<br />
char *pChar = (char *)GlobalLock(hData);<br />
strcpy(pChar,"This is a test");<br />
GlobalUnlock(hData);<br />
COleDataSource source;<br />
<br />
source.CacheGlobalData(<br />
CF_TEXT,<br />
hData);<br />
DROPEFFECT de = source.DoDragDrop(DROPEFFECT_COPY | DROPEFFECT_MOVE);<br />
}<br />
Which should allow me to drag text from my window to an ole enabled drop target. The above code is called in my OnLButtonDown handler. Everything seems to be ok until the COleDataSource::DoDragDrop function calls ::DoDragDrop() (OleDrop1.cpp line 181), which should return when the operation completes. But it returns immediately with DROPEFFECT_NONE which should not be the case. The way COleDataSource::DoDragDrop is written wont let me examine the return code for the function so I can see why its failing.
Has anyone got any ideas as to what the cause of the problem could be? My heads getting sore banging against a wall here
If you vote me down, my score will only get lower
|
|
|
|
|
No worries, finally tracked down the problem.
Its seems you need to call:
<br />
AfxOleInit();<br />
When your appp starts up to enable OLE. Not once in the standard docs for this is this mentioned anywhere. Grrrrr!
If you vote me down, my score will only get lower
|
|
|
|
|
Hi,
I'm working in VC++6 and using ODBC connection.
I'm debugging my code from my system. The exe and related dlls are in a different system. Suppose in the code i've 2 places where db functions are called(which in turn call Requery()/ Open()).
Just before i reach the first db function call, i remove the network connection and restore it (by unplugging and plugging the n/w cable).
When it reaches the 1st db call, it is giving me unhandled exception instead of going to DBException catch block.
In the override Open()function of CRecordset, I tried to re-establish the dbconnection if it is not there. Now if i remove n/w and restore it, it moves smoothly in the first call to db function. But in the 2nd call, i'm getting unhandled exception, and the database pointer itself is NULL now.
Why is this happening?
If the source code, exe and the dlls are in the same system, it goes to the DBException catch block without any change to restablish the db connection.
Thanks,
Sanju
-- modified at 6:42 Wednesday 22nd August, 2007
|
|
|
|
|
Hi all,
I've an ActiveX control with me and i want to aggregate this ActiveX control from a component.How can i do this? Anyone please help me
Thanks in advance
ss
|
|
|
|
|
hey Friends..
CDC::Arc(...) is not supported in eVC++ (WinCE).
Please give me some hint to draw Arc and Pie without using MFC methods
thanks ...
|
|
|
|
|
look at Win32 Api Arc and ArcTo
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|
|
Win32 Api Arc and ArcTo ...etc are not supported in eVC++(WinCE)
|
|
|
|
|
Win32 Api arenot supported in WinCE!!
|
|
|
|