|
hello
please help to solve this problem
when i coonect vc++ to mysql
and use this code to fetch data from mysql
mysql_query(myDB,"select password from login where user= \'" + user + "\'");
i = mysql_query(myDB,"select * from login");
res=mysql_store_result(myDB);
row = mysql_fetch_row(res);
MessageBox(row[0]);
but when i use debugger at this line row = mysql_fetch_row(res);
an unhandled exception myapp.exe(libmysql.dll) access violation appears in message box and when i click ok then in output window of vc++ following messages appears :
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'C:\DOGRA\company\libmySQL.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wsock32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL'
Loaded symbols for 'C:\WINDOWS\system32\MFCO42D.DLL'
Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\MSCTFIME.IME', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
Warning: no listbox item selected.
Loaded 'C:\WINDOWS\system32\mswsock.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\dnsapi.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winrnr.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wldap32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\rasadhlp.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\hnetcfg.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\wshtcpip.dll', no matching symbolic information found.
First-chance exception in company.exe (LIBMYSQL.DLL): 0xC0000005: Access Violation.
The program 'C:\DOGRA\company\Debug\company.exe' has exited with code 0 (0x0).
now please help me to solve this problem
hi
|
|
|
|
|
Please stop posting this question. You posted it once, that's enough.
|
|
|
|
|
sorry sir
but sir i dont got my solution
hi
|
|
|
|
|
That's no excuse for acting like a whiney brat. If someone with experience sees your question, they will post an answer. If you post over and over, they will get annoyed, and might ignore your question. So be patient.
|
|
|
|
|
We already did, he seems unwilling to debug or try anything to identify the problem.
The issue is not the NULL recordset, but a combination of dodgy error handling and a refusal to look into why he is getting NULL from the query.
|
|
|
|
|
I think this is a reposting of your previous query. Is the earlier thread not providing you any solution. I think it is the same problem. Your recordset is not returned instead just NULL is there so you end up with an Access Violation Error.
Have you debugged the application after necessary changes were made to it?
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
He's basically ignored everything we suggested in the original question.
I will not help anymore as he could find the problem in 2 seconds using the debugger.
regards,
|
|
|
|
|
if that is the case I go with you. We are not dumb fools replying to people who are deaf.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
So did you try what we suggested in your original question ?
You really should learn how to use the debugger, this would take seconds to find.
I've already told you why it's crashing, try debugging it to see why you are getting no records back.
regards,
|
|
|
|
|
|
can any one explain the sequence steps how x value changes.
i.e expand the below expression for easy understanding
x=x++ + ++x + ++x + --x;
printf("%d",x);
y=x++ + ++x + ++x + --x;
printf("%d",x);
printf("%d",y);
I executed this exp in vc++ i got 1st exp values as x=14
and in second exp i got x=4 and y=13.
sorry i got y=13;
|
|
|
|
|
The difference between y = 13 and x = 14 is because of the postfix operator on x, x++
This get evaluated after the result is assigned to y. Simplify the expresion to see what is happening.
x= 4;
x = x++;
x == 5;
x = 4;
y = x++;
x == 5;
y == 4;
4 is assigned to y before x is incremented.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
And you have no other line modifying or reseting "x" ??? Just this code?
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
|
Hello everyone,
The prototype of DeleteFile is,
BOOL WINAPI DeleteFile(
LPCTSTR lpFileName
);
I am wondering if the input parameter (string) is multi-byte characters or wide characters, how should I pass them in? Do I need to do any conversions?
thanks in advance,
George
|
|
|
|
|
George_George wrote: BOOL WINAPI DeleteFile(
LPCTSTR lpFileName
);
The input parameter is of type const TCHAR*. TCHAR is defined in winnt.h as WCHAR if UNICODE is defined or char otherwise. My advise is therefore to pass a TCHAR pointer and you can't go wrong.
<br />
LPCTSTR lpFileName = _T( "C:\\Temp\\someFile" );<br />
::DeleteFile( lpFileName );<br />
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Thanks Matthew,
I think in my situation I do not need to care whether I passed multi-byte character or wide character to DeleteFile, since LPCTSTR is adaptive to multi-byte character or wide character according to the settings of UNICODE macro. Right?
regards,
George
|
|
|
|
|
LPCTSTR is a generic-taxt-mapping type:
(1) if your build is UNICODE (_UNICODE symbol defined) then the string is a wide-character one.
(2) On the other hand, if your build in ANSI or DBCS then LPTCSTR is defined as const char * .
N.B.
Visual Studio .NET, as default, targets its builds to UNICODE (Visual Studio 6 has the opposite default behaviour).
Hope that helps
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks CPallini,
I think in my situation I do not need to care whether I passed multi-byte character or wide character to DeleteFile, since LPCTSTR is adaptive to multi-byte character or wide character according to the settings of UNICODE macro. Right?
regards,
George
|
|
|
|
|
Right only if you use generic text mapping strings, as suggested by Matthew Faithfull.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks CPallini!
What do you mean "generic text mapping"?
regards,
George
|
|
|
|
|
Basically, follow Matthew Faithfull suggestion, for an example, see here http://msdn2.microsoft.com/en-us/library/4t912wf5(vs.80).aspx[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks CPallini,
Good resource.
regards,
George
|
|
|
|
|
Hello masters, I've to do some mathematical operations on Matrices & arrays on large number of elements using C++. I like to mention some of main functions which I've to use - matrix multliplication, matrix inverse, sorting on arrays, Finding min / max from the list / arrays, etc.
I find there are number of libraries on the internet. So that I like to use some maths libraries.
So request you to suggest me the neccessary information about the higher performance maths library.
Thanks & regards,
Shashikant
|
|
|
|
|
The best option is check those libs out and choose the one that has what you need. But I thing there is not any operation you need in the standard "math.h" and "math.lib". Anyways... they are not difficult. Every operation from the list can be solved programmng your own functions with in a short code. I.E.
Matrix Multiplication
double A[M1][N1];
double B[M2][N2];
double C[M3][N3];
void Mult_Matrix (int m1, int n1, int m2, int n2)
{ int i = 0, j = 0, k = 0;
if (n1 != m2)
return;
for (i = 0; i < m1; i++)
{
for (j = 0; j < n2; j++)
{
while (k < n1)
C[i][j] += A[i][k] * B[k][j];
}
}
}
And the rest are to be not difficult. By the way... I have done it in the samplest way. You can give a pointer to your class CMatrix as return, give error messages and so on... It depends on what you need/want to do. Try it and ask if you have problems, we'll help you.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|