|
David you are such a great help.
Thank you!
|
|
|
|
|
|
Programm3r wrote: ...when I perform the function GetRowsAffected() the return code is -1, stating that something went wrong. Not sure what
How about stepping into the Execute() method to find out why?
"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
|
|
|
|
|
I would love to, but I keep getting a 'External Exception C000000008' Error Window as I perform the pdb.DriverConnect() function ....
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
So step into that method to find out why.
"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
|
|
|
|
|
The second time I call this function to connect to another database (I created another instance), I recieve the exception message.
ret = SQLDriverConnect(m_hDbc,
hWnd,
(SQLCHAR*)szConnStr,
SQL_NTS,
(SQLCHAR*)szConnStrOut,
sizeof(szConnStrOut),
&pcbConnStrOut,
(SQLUSMALLINT)drvConn);
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Channeling David Crow...
"So step into that function..."
Do you really mean the exception message is "ret = SQLDriverConnnect... etc"?
If not, it would help if you actually say what exception you're getting. Are all the pointers you supply the function fully valid? ascii instead of unicode (or vice versa), szConnStrOut at least as big as it need to be? is pcbConnStrOut needing to be set to something going in as well as out?
Etc.
If you look at the SQLDriverConnect function help page, does it say it raises an exception if it can't connect? If so, wrap it with TRY / CATCH etc, and swear at the user for picking a wrong database. And so on....
Nobody else is going to be able to help with that sadly, as it will depend on a big lump of your code.
What you can do is to make a small test program, with those parameters hard coded and carefully validated, then call the function. If *that* works, then you have a bug in your main program and are feeding the function junk.
Iain.
(ps, I have little idea about SQL - this is generic programming / debugging advice)
|
|
|
|
|
Iain Clarke wrote: ...generic programming / debugging advice)
Which seems to be a rare commodity of late.
"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
|
|
|
|
|
Thanks for your input. I would like to add that this only occurs when I make use of an Oracle database. More specific Oracle 9 and 10. When I make use of MySQL there is not exception nor error.
Iain Clarke wrote: Do you really mean the exception message is "ret = SQLDriverConnnect... etc"?
No, since I'm working in Borland Enterprise Edition 2006, this is the only message that the IDE is giving me.
Any ideas about the Oracle part ?
Thanks in advance,
Regards
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
I have been working on a project in MFC, and I am now doing documentation on all of my functions. Is there a way to do XML function documentation equivilent to "///" in C#? I will be using sandcastle to do the compliling.
My appoligizes for not putting this thread in the XML / XSL forum
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Hi everybody i am new with win32 app. I want to set background color and color inside the controls. I have no idea how it works. Definitely not from Properties as we do in web app. I saw many methods and all i tried the site http://www.functionx.com/win32/Lesson16.htm which is i guess the best for win32 apps. I see some methods in this page but i dont how i can call this methods in my OnInitDialog() method.
I see at places
HDC hDC;
WPARAM wParam;
hDC = (HDC)wParam;
hDC->SetBkColor(hDC,RGB(200, 0, 0));
but then if i write this code in myOnInitDialog() then i need to pass this parameters HDC, WPARAM which i dont.
I believe it must be preety simple, please give me your suggestion if any,
Any help would be appreciated.
Mady
|
|
|
|
|
Did you see WM_CTLCOLOR message.
|
|
|
|
|
Firstly thanks for the immediate response.
Now I had seen this (WM_CTLCOLOR ), but i dont remember exactly in which part?
I see everytime they are mentioning about two main methods those are
1. INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow).
2.LRESULT CALLBACK WindProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
I have copied them in my .cpp file.
But unfortunately i dont know where to call these methods. These methods are never being called. I guess they should be called on OnInitDialog(); but then i am not using any of these parameters in my code such as HINSTANCE, LPSTR or HDC.
If you want please let me know i shall paste my complete code here for better assistance.
Mady
|
|
|
|
|
mady1380 wrote: I have copied them in my .cpp file.
You don't need either if you are using MFC.
"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
|
|
|
|
|
mady1380 wrote: I see at places
HDC hDC;
WPARAM wParam;
hDC = (HDC)wParam;
hDC->SetBkColor(hDC,RGB(200, 0, 0));
You may have seen it, but it definitely won't work.
For an example of how to change the font of a static control, see the Extras section of this article. Changing the color requires only a very minor change.
"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
|
|
|
|
|
Thanks David.
Will try and get back to you whatever the result is.
Regards
Mady
|
|
|
|
|
Mady1380 - You have to intercept the method called when the color of the controls is determined - OnCtlColor().
OnCtlColor is called each time a control is being painted/repainted. Examine nCtlColor to see what type of control is being painted.
The following code makes the background of an edit control either yellow when it has the focus, or normal white when it does not have the focus. It also forces the text color to black. Add this method to your dialog class.
<br />
BEGIN_MESSAGE_MAP(CMyDlg, CDialog)<br />
ON_WM_CTLCOLOR()<br />
END_MESSAGE_MAP()<br />
<br />
...<br />
<br />
<br />
HBRUSH CMyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
<br />
if (CTLCOLOR_EDIT == nCtlColor)<br />
{<br />
if (GetFocus() == pWnd)<br />
{<br />
pDC->SetTextColor(RGB(0, 0, 0));<br />
pDC->SetBkColor(RGB(255, 255, 0)); <br />
pDC->SetBkMode(OPAQUE);<br />
return CreateSolidBrush(RGB(255,255,0));
}<br />
else<br />
{<br />
pDC->SetTextColor(RGB(0, 0, 0));<br />
pDC->SetBkColor(RGB(255, 255, 255)); <br />
pDC->SetBkMode(OPAQUE);<br />
return CreateSolidBrush(RGB(255, 255, 255));
}<br />
}<br />
return hbr;<br />
}<br />
<br />
Experiment to get a better feeling by changing background colors, text colors, types of controls (EDIT, STATIC, etc.).
Hope this helps.
Gary
|
|
|
|
|
In my program of creating an editor i need to display calltips that is while debugging if keep the cursor over the variable it should show u the vale of the variable...
but i don't know how to create a calltip itself in scintilla..
even then i used SCI_CATTTIPSHOW,SCI_CALLTIPACTIVE AND I'M not getting any calltip displayed...
can anyone suggest me the basic procedures of how to get a calltip in scintilla based editor...
|
|
|
|
|
You only need to ask your question once. Asking the same thing again because you are not patient enough will get you ignored.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
leckey wrote: You only need to ask your question once. Asking the same thing again because you are not patient enough will get you ignored.
Everytime I see someone doing that, doing a "PLZ HELP URGENT," Cross-Posting, or requesting "codes" I check the profile. And they all have one thing in common:
Location India
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Justin Perez wrote: And they all have one thing in common:
Location India
I concur. I realize there are exceptions to the rule, but for the most part, ...
"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
|
|
|
|
|
Happy Birthday, leckey!
|
|
|
|
|
Can any1 tell me how do i detect start and close of FireFox browser?
Does it send any message or generate any event at time of start up and closing?
Please tell me kinda solution which I can implement in MFC.
Thanks.
|
|
|
|
|
::WaitForSingleObject() is of any help ?
|
|
|
|
|
s_v_patel wrote: Does it send any message...at time of start up and closing?
WM_CREATE comes to mind. What exactly are you trying to accomplish?
"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
|
|
|
|