|
from what i get this is a question where more programmers need help, so again:
i'm a novice programmer on Visual studio.net c++ and i need to connect it to mysql 4.1.17, it can be done with myodbc, bytefx or oledb, or another one that results, to make the normal operations (insert, select, delete, update ).
please help fast, it's really importante, and a sample application would be great, send it to horus.cv@gmail.com, but the code and the explanation is also good.
thanks sigh: sigh:
|
|
|
|
|
Why don't you start doing the expected sample application your self. And post the problems over here as you come accross.
Btw pls check this [^] list of articles
suhredayan There is no spoon.
|
|
|
|
|
string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" + "SERVER=localhost;" + "DATABASE=projecto;" + "UID=root;" + "PASSWORD=123;" + "OPTION=3";
MessageBox::Show(MyConString);
System::Data::Odbc::OdbcConnection MyConnection = new OdbcConnection(MyConString);
MyConnection.Open();
DataSet dataset=new DataSet();
System::Data::Odbc::OdbcCommand MyCommand = new OdbcCommand("select * from contactos",MyConnection);
MyCommand.ExecuteNonQuery();
this is the code i have so far, and it's not working.
i get errors like mycommand cannot be destroied and c:\Documents and Settings\horus\Desktop\estagio\progs em c++\mysqlclient\Form1.h(92): error C3861: 'MyCommand': identifier not found, even with argument-dependent lookup
, and many others.
please help
|
|
|
|
|
|
hello,
I am working on graph plotting and i need to know if it is possible to display a dialog box in the client area of an SDI or MDI window?And is it possible to display it a particular location in the client window;say at the bottom;along the frame.If it is possible what are the steps?
please reply urgently
sayali
|
|
|
|
|
Yes, It is very Simple
You Must Create Dialog Dynamically
i.e.
CMyDialog dlg = new CMyDialog();
.....
delete dlg;
You Can Pass Position Param to Dialog with Constructor
or By Another Func, Like CMyDialog::SetParams(....);
|
|
|
|
|
|
Guys, I don't know if that's the right place to post but am in deep trouble. I've been trying to use windows sockets for sometime on visual studio .NET, but for some wierd reason my code won't compile. The compiler is always giving a C2065 error(undeclared identifier), I believe the reason may be that visual studio has a wierd macro definition which is getting some header files not declaring the SOCKET identifier. Any Help would be greatly appreciated, so would any other guidline or direction to some other forum... Thanks guys
Bashar
|
|
|
|
|
Not enough info What line causes the error? What is on that line (and the line before it)? Have you looked up C2065 in MSDN?
You will get better answers if you actually provide some information for us to use.
Within you lies the power for good - Use it.
|
|
|
|
|
void func(UINT nOperation)
{
#if (nOperation == OPERATION_1)
#define OPERATION(spObj, nParam) fun1(spObj, nParam)
#elif (nOperation== OPERATION_2)
#define OPERATION(spObj, nParam) func2(spObj, nParam)
#elif (nOperation== OPERATION_3)
#define OPERATION(spObj, nParam) func3(spObj, nParam)
nFrameNo)
#else
#define OPERATION(spObj, nParam)
#endif
....
OPERATION(spObj, n) // whatever nOperation be, it always call fun1,why???
}
|
|
|
|
|
Macros don't work at runtime; they are processed before compilation. Try something like this instead:
void func (UINT nOperation)
{
switch (nOperation)
{
default:
break;
case OPERATION_1:
fun1(spObj, nParam);
break;
case OPERATION_2:
fun2(spObj, nParam);
break;
case OPERATION_3:
fun3(spObj, nParam);
break;
}
}
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Jose Lamas Rios wrote:
case default:
No case needed here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
You've mixed up precompiler directives with code. Macro expansion (and execution of other precompiler directives) happen before code is compiled.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Hi,
I need to know how i can detect a keylogger.
I've found some basic technique in doing the same.
The technique is
1.Get the image of the user32.dll
2.Disassemble the dll( traverse the user32.dll ie find the memory location of all the api in the user32.dll)
3.If the api is hooked means it will be having a jump instruction when the original api is called.
4.If this jump instruction points to a memory location outside the image of the user32.dll then the api is hooked otherwise it is not.
5.I've found the memory address of the hooked function.
My question how can i detect the dll or exe from the function pointer address which i got from the discrepancies i found when the api is hooked.
Pls provide a solution to that.
Regards
saravanan
|
|
|
|
|
Dear All,
We have a application where VB 6 is calling VC++ 7 dll's
and entry point of the whole application is in VB 6
so is it possible to debug the VC++ 7 code from VB 6 ???
regards
Manjunath
|
|
|
|
|
Yes, the only thing to do is to go in the project settings and specify which executable must be runned for debbug session. There you provide the path to your VB6 application.
One thing very important: be sure you have exactly the same dll version in the folder of your VB6 application (or the folder where it is using it generally) and the version in the debug folder. So, each time you change a single line of code in the dll and recompile, don't forget to move the dll in the application's folder.
|
|
|
|
|
Hello !
Is there a function to read data from stdin (keyboard) without actually block until a character is typed in ? For example, getc waits until a char is typed on the keyboard. What I would like to have is a function to will look if there is data present in the input buffer. If yes, it returns the data, if no, it returns an error.
And yes, this is for a 'console' application (in fact this is an embedded platform).
Thanks
|
|
|
|
|
use kbhit() for checking input buffer
|
|
|
|
|
U can use PeekConsoleInput() and ReadConsoleInput(). These are not the blocking calls
Anil Kumar
|
|
|
|
|
When drawing to a CView you normally draw onto the whole client area of its attached CFrameWnd, ryt? Now I want to implement a Print-Layout View (in MS Word)/ Print-Preview style view wherein you could see the page, and the view doesn't occupy the whole client area of the frame window...
Any suggestions? article or link where i can get some information regarding this..
tnx a lot.. in advance
maverick
"watch the birdie!"
|
|
|
|
|
CWinApp::CreatePrinterDC will give you a dc for the active printer, and pDC->GetDeviceCaps(PHYSICALWIDTH), pDC->GetDeviceCaps(PHYSICALHEIGHT) will give you the paper dimensions.
Once you have the dimensions, fill the background with a color of your choice, and then use the dimensions to draw a white "paper" rectangle using pDC->Rectangle.
If you want zooming, you'd have to use SetWindowExt/SetViewportExt in OnPrepareDC to set your zoom level.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
Painted on the side of a dog trainer's van: SIT HAPPENS
|
|
|
|
|
Hey Thanks for this info.. Well, I don't want a print preview per se.. Just want my interface to be that way, with zooming and scrolling.. Anyway, thanks again. This will be a good help as well...
regards,
Anton
"watch the birdie!..."
|
|
|
|
|
If you look at MS Word, with a new blank document.. and then choose View->Print Layout menu.. Now, you'll see the white page on the brown/gray background.. on a 100% view
I know that on normal circumstances, the client area of CView entirely occupies the client area of the CCHildFrame..
Now with the Print-Layout View, Is it possible that the white page is drawn on the CView client area but it is NOT occupying the whole client area of CCHIldFrame so thats why we are seeing the background color of CChildFrame?
Or is the white page and the background color are all drawn together in the client area of CView?
Maverick
"watch the birdie!..."
|
|
|
|
|
Here's a very simple implementation that simulates drawing a page.
First, create an SDI project that uses CScrollview as its view class.
Make the following changes to the myview.cpp file.
1) Add two constants to the top of the file:
<br />
CPoint g_ptOrigin(50,50);<br />
<br />
CRect g_rcPaper(0, 0, 850, 1100);<br />
2) In the OnDraw function, insert the following code:
<br />
pDC->SetBkMode(TRANSPARENT);<br />
pDC->Rectangle(g_rcPaper);<br />
pDC->TextOut(50, 50, _T("This is a test"));<br />
3) Create an override for OnPrepareDC, and insert the following code after the call to the base class:
<br />
<br />
pDC->OffsetWindowOrg(-g_ptOrigin.x, -g_ptOrigin.y);<br />
<br />
4) Add a handler for the ON_WM_ERASEBKGND message and replace with the following code:
<br />
CRect rcClient;<br />
GetClientRect(rcClient);<br />
pDC->FillSolidRect(rcClient, RGB(127,127,127));<br />
return (TRUE);<br />
- Step 4 draws your gray background
- Step 3 offsets the dc origin so that drawing is relative to the top left of the paper, not the top left of the client area
- Step 2 draws the paper, with the offset in place
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
Painted on the side of a dog trainer's van: SIT HAPPENS
|
|
|
|