|
|
Hi,
I am trying to use cdhtmldialog to display a html page in the resource folder, it works fine untill I want to have more than one html file.
Do anyone know how to change to the other html file while having the original one displayed? Thanks a lot!!!
|
|
|
|
|
hi all,
I am using SQLConfigDataSource(HWND hwndParent,UINT fRequest, LPCSTR lpszDriver, LPCSTR lpszAttributes) Method to configure the ODBC datasource..
The Problem is I have used the above Method Like this:-
SQLConfigDataSource(NULL,ODBC_ADD_DSN, "SQL Server\0","DSN=myfinger\0" "Server=SERVER\0" "Database=emp\0");
This working perfectly and create the DSN..
Now I want to give the DSN ,server ,Database Name as variables..
But when I create create Like this This is not working..
CString var4,v1,v2,v3;
v1="myfinger";
v2="SERVER";
v3="emp";
var4.Format(" \"DSN=%s\0\" \"Server=%s\0\" \"Database=%s\0\" ",v1,v2,v3);
SQLConfigDataSource(NULL,ODBC_ADD_DSN, "SQL Server\0",var4);
But No error When compilling the Program..But Not creating the DSN..
So please any know the correct way to show this please send me a reply...
Thanks in advance..
|
|
|
|
|
There is no need to put the extra \0 characters in the string. CString::Format() does not like them. Looking at var4 after calling Format() would have confirmed this.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Also, when you have a variable number of arguments, which follow a formatting type string, the compiler does not necessaily know what to types to cast the arguments into, so you should probably always cast the CString manually in such a situation. I always do and boy have the wierdness factors decreased.
So, it would like something like this, following mine and David's suggestions:
var4.Format(" \"DSN=%s\" \"Server=%s\" \"Database=%s\" ",(LPCTSTR)v1, (LPCTSTR)v2, (LPCTSTR)v3);
|
|
|
|
|
hi ,
Sorry that is also not working..
Compilling the Project perfectly..But Not creating the DSN..
If I used the Method like this:
SQLConfigDataSource(NULL,ODBC_ADD_DSN, "SQL Server\0","DSN=myfinger\0" "Server=SERVER\0" "Database=emp\0");
This working perfectly and create the DSN..
This is working ...
But I want to pass the values for DSN,Server and Database/b>
please help...
|
|
|
|
|
SQLConfigDataSource -> lpszAttributes
List of attributes in the form "keyname=value". These strings are separated by null terminators with two consecutive null terminators at the end of the list.
Try this instead:
CString var4, v1, v2, v3;<br />
<br />
v1 = "myfinger";<br />
v2 = "SERVER";<br />
v3 = "emp";<br />
<br />
var4.Format("DSN=%s\0Server=%s\0Database=%s\0", (LPCTSTR)v1, (LPCTSTR)v2, (LPCTSTR)v3);<br />
<br />
SQLConfigDataSource(NULL, ODBC_ADD_DSN, "SQL Server", (LPCTSTR)var4);
I think this will work for you.
|
|
|
|
|
hi,
Thanks for ur reply..But it is also not working..You can also try to create DSN using above ur code:
void testDlg::OnButton2()
{
CString var4, v1, v2, v3;
v1 = "myfinger";
v2 = "SERVER";
v3 = "emp";
// this generates paramaters separated by a single NUL character
// and a sting terminated with two NUL characters
var4.Format("DSN=%s\0Server=%s\0Database=%s\0", (LPCTSTR)v1, (LPCTSTR)v2, (LPCTSTR)v3);
if(!SQLConfigDataSource(NULL, ODBC_ADD_DSN, "SQL Server\0", (LPCTSTR)var4))
AfxMessageBox("error");
}
But I got Error for this..
Thanks in advance..
|
|
|
|
|
I have created a separate thread to continuously monitor the serial port (i.e. to wait for something to arrive and then read it out)
Is it possible to write to the serial port at the same time (in the main thread), or does the read thread block. I have tried...it didn´t work, but the problem might be somewhere else...
If I cannot send while monitoring the port, what would be the proper solution? Do I have to temporarily Suspend, Sleep or Abort the thread while performing the write operation?
doneirik
|
|
|
|
|
IIRC you should use overlapped IO for the serial read write.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
it is not neccessary to write in a thread - thread is for waiting (reading) events.
before u write, u need to check if writing (sending) buffer is empty - otherwise writing fails.
i have worked for years on your current job.
includeh10
|
|
|
|
|
How can I change the background color of dialog form in a MFC application.
can anyone help me regarding this project ?
Philip
|
|
|
|
|
Write an event handler for WM_CTLCOLOR and change the color there.
Found on Bash.org
I'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet
My Articles
|
|
|
|
|
Here is Small Code that Will Help
HBRUSH CExeCreatorDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor ==CTLCOLOR_EDIT)
{
return hbr;
}
::SetTextColor(pDC->GetSafeHdc(),DLGTEXTCOLOR);
::SetBkColor(pDC->GetSafeHdc(),PUNTO_BGCOLOR);
hbr=CreateSolidBrush(PUNTO_BGCOLOR);
return hbr;
}
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi Alok, I am Butt not Bhatt . There is a very small difference in spelling but a lot of difference otherwise.
Found on Bash.org
I'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet
My Articles
|
|
|
|
|
Bro!
Please Don't Mind, there is Nothing Intentional.
Aamir Butt wrote:
there is a very small difference in spelling but a lot of difference otherwise.
Yeah I know the meaning of these two Surnames, I am sorry by heart, If it hurt you.
"I Think this Will Help"
<h5
alok="" gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Its OK, no hard feelings
Found on Bash.org
I'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet
My Articles
|
|
|
|
|
I have seen the code u sent to me through email. Normally its not a good idea to contact individual person coz if u ask question here, other people can get benefit of it as well.
Well, the problem in that code is that the place where u have checked
if(pWnd->GetDlgCtrlID() == IDD_BGCOLOR_DIALOG)
replace it simply with
if(pWnd == this)
Well, the reason is that you want to change the background color of dialog and GetDlgCtrlID returns the IDs of controls on the dialog not of dialog itself. You can check it simply by the if condition I have written above.
Found on Bash.org
I'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet
My Articles
|
|
|
|
|
dear all,
OS: Windows XP/2k
I am developing an application running with service. can anybody tell how to add desciption to the service
(i.e in control panel display -> service description)
rohit
|
|
|
|
|
use ChangeServiceConfig2()
eg:
SERVICE_DESCRIPTION sdBuff;<br />
sdBuff.lpDescription = _T("This description is shown by SCM.");<br />
ChangeServiceConfig2(hService, SERVICE_CONFIG_DESCRIPTION, &sdBuff);<br />
suhredayan There is no spoon.
|
|
|
|
|
|
Hi,
How do I create a new window from an existing object that shares the original object instance ? I'll explain with an example.
Lets say you used IE to browse to a secure url that requires authorization.
After authorization, creating new window by using menu File->New Window gives you a new window that shares the authorization status. You don't have to login again in the new window.
How do I do it assuming I have CHtmlView ?
Thanks
|
|
|
|
|
Hi,
Can Anyone please suggest a Regular Expression which can validate an expression like "< 200",
"<= 200",
"> 200" or
">= 200"
Thanks a lot.
Amit
|
|
|
|
|
(>|>=|<|<=)\s?([0-9])+
\1 is the evaluation, \2 the number
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
I want to determine, a file is text file or binary file(file name dosen't have file extension).Is there any API in Windows SDK?
Thanks
MJVALAN
|
|
|
|