|
caykahve wrote:
and the message box says:
C:\Program Files
I need to add something at the end of this string and then i try to use it in another function which needs the paths in double back slashes like:
"C:\\Program Files"
Then I try to do a conversion in PFPath in order to double the backslashes to change from
"C:\Program Files" to "C:\Program Files"
You don't actually need any conversion. The double back slash is needed only when you are writing a string literal in your code. That's because the back slash is a escape character (used in combinations like \t, \r and \n, to represent a tab, carrier return, and line feed characters), when what you want is an actual back slash character, you need to type it twice. However, the double back slash pair represents one (single) back slash character in memory.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I have a problem on updating an sql server database.
The connection string that I give is as follows:
"Description=description name;DRIVER=SQL Server;SERVER=server_name;APP=Microsoft\x00ae Visual Studio .NET;WSID=wsid;DATABASE=dbtest;Network=DBMSLPCN;Trusted_Connection=Yes"
I open multiple tables of the database as snapshot.
The first problem that I have is that I want to search for a value of a field in one of the tables, so I use the MoveFirst and MoveNext functions. The MoveNext function doesn't work!
The second is that when I run the AddNew function I get the error "Recordset is read-only"!
Does anyone know how can I get the privilege to move in and change the database?
Thanks in Advance
sirtimid
|
|
|
|
|
Hello all,
How can I programatically change the default push button style from one button to another button in a dialog?
|
|
|
|
|
If you want to copy a button's style to another one you can get it by using GetStyle() or GetStyleEx() that returns a DWORD and set the other button's style by using ModifyStyle or ModifyStyleEx.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
I mean:
<br />
DWORD dw = m_button1.GetStyle();<br />
m_button2.ModifyStyle(0, dw);<br />
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Thank you.
But the problem is still alive.
I use the following code for show buttons which are hidden initially. If the fDefault is set TRUE that button should have default push button style. Always button[0] gets this style. I'm sure that I will set this style only to one button at a time.
void CDlg::Enable(int iBtn,LPCSTR sTxt,BOOLEAN fDefault)
{
m_button[iBtn].SetWindowText(sText);
m_button[iBtn].ShowWindow(SW_SHOWNORMAL);
if(fDefault)
m_button[iButton].ModifyStyle(0,BS_DEFPUSHBUTTON);
}
Can you help in this problem, please?
|
|
|
|
|
Use SetButtonStyle instead of ModifyStyle.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
You can do it, at design time, in the resource editor via the button properties->tab. But I don't remember how to do it at run time.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
|
Hi,
Iam new to win 32 programming. Currently i have a resource in a DLL consisting of dialog resouces and other. Now how do you i load the resouce in the DLL to my existing win 32 application?
Your help is greatly appreciated.
Thanks,
pradeep
|
|
|
|
|
And I need to do this at the runtime.
|
|
|
|
|
Here is an example as requested.
HMODULE hModule = LoadLibrary("C:\\another_resource.dll");
if(hModule != NULL)
{
HWND hDialog = CreateDialog(hModule, MAKEINTRESOURCE(ID_DIALOG), , );
HBITMAP hBitmap = LoadBitmap(hModule, MAKEINTRESOURCE(IDB_BITMAP);
FreeLibrary(hModule);
}
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
Use the LoadLibrary method to load your dll and call LoadResource to load the resources in it.
<font=arial>Weiye Chen
Life is hard, yet we are made of flesh...
|
|
|
|
|
hai,
I am not getting selected Date
I wrote code like these.....
Here m_month --- is CMonthCalCtrl member variable
Date Field is getting error.
Month and Year fileds are getting Correctly.
Plz Help me.
This is Urgent need..,
------->
CString strDate;
CTime ct;
m_month.GetCurSel(ct);
strDate.Format("%2d-%2d-%2d",ct.GetDay(),ct.GetMonth(),ct.GetYear());
MessageBox(strDate);
---
Praveen Chowdam Kumar
|
|
|
|
|
I think it's a known issue. The way to workaround this is by using SYSTEMTIME instead of CTime:
<br />
SYSTEMTIME ct1;<br />
<br />
if( m_month.GetCurSel(&ct1) )<br />
{<br />
strDate.Format(_T("%02d-%02d-%2d"),ct1.wDay, ct1.wMonth, ct1.wYear );<br />
MessageBox(strDate);<br />
}<br />
I hope that solves your problem,
Marc Soleda
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
|
1.0 ??? Hasn't it been usefull?
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
-- modified at 6:33 Monday 29th August, 2005
|
|
|
|
|
Hi
I have developed a simple dialogue based application. This application contains only one static control in which I show some text continuously. Now I want to put a code so that when user presses some key combination like Ctrl + M, Ctrl+Alt+M or any key, it should be closed.
But my OnKeyDown() function doesn't work as I have Static Control on my dialogue and it takes the focus so all my key down event goes to static control.
Any idea what to do ?
Thankx in advance
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
You can attach an accelerator resource to your dialog. In the accelerator table, you can map the key combination to some command and then add an entry to the message map to specify a command handler.
Take a look at this posts[^] for details on how to attach the accelerator.
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Thankx a lot
It will definitely help me a lot
Once again thankx for your kind response
Amarelia Maehsh
Gujarat
India
|
|
|
|
|
You'll have to handle the WM_KEYDOWN message in PreTranslateMessage member function.
<br />
BOOL CYourDlg::PreTranslateMessage(MSG* pMsg) <br />
{<br />
if(pMsg->message == WM_KEYDOWN)<br />
{<br />
...
}<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}<br />
I hope it helps,
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Modifing the above code can we find which particular key is pressed?
Thanx
V
|
|
|
|
|
pMsg->wParam right? GOT IT!!
Thanx
V
|
|
|
|
|
You're right !!
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
is it possible to capture other windows' events (without using Hooks?)
Thanx
V
|
|
|
|