|
Why do you need this conversion? What are you trying to achieve? I am asking this because the 'const 'ness would matter much, only if you are trying to cast the const away. Are you trying to pass an unsigned char* to a function that expects a const char*? There's no harm in that case, because you are merely providing a modifiable value to a function which promisingly will not modify the value given to it. You also need to know the possible loss of data that might occur while converting between signed and unsigned datatypes.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Try this
unsigned char *chr = Some_value;<br />
const char *ch = (const char *)chr;
You sholud also use Google sometimes...
Mukesh Kumar
Software Engineer
|
|
|
|
|
Hi Guys,
If a user downloads something from the net through Firefox/IE...how can i track,how much data the user had downloaded and from which site the user downloaded the data?
Plse somebody help me on tht.
|
|
|
|
|
You need to tell us which portion of your query is, in any way related to Visual C++ first.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
First of all I agree with Rajesh. What is your point in C++ in this question.
Secondly, I guess your question is beyond programming so I'm saying "don't bother, use tools like NetLimiter"
|
|
|
|
|
You probably wanted to reply to him, and not to me.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Repeat from a few days ago.
|
|
|
|
|
You must see this[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
leckey wrote: Repeat from a few days ago.
he hehe
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
All my hidden toolbars are docked, if one is already docked, after the commands Print or Print Preview
Project MFC AppWizard(exe)
16 toolbars are created in the main frame, with code as follows,
if (!m_wndStiffenerBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | NULL | CBRS_TOP| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||!m_wndStiffenerBar.LoadToolBar(IDR_STIFFENER))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_wndStiffenerBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndStiffenerBar);
Like this toolbar, as shown above, all are initially hiddens
//Toolbars can be docked with menu command, as follows
void CMainFrame::OnMoveStiffener()
{
// TODO: Add your command handler code here
BOOL bVisible;
bVisible=((m_wndStiffenerBar.GetStyle() & WS_VISIBLE)!=0);
ShowControlBar(&m_wndStiffenerBar,!bVisible,FALSE);
RecalcLayout();
}
void CMainFrame::OnUpdateMoveStiffener(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->SetCheck(((m_wndStiffenerBar.GetStyle() & WS_VISIBLE)!=0));
}
The code is standard and works well but if a single toolbar is docked and if I give Print preview command, all the 16 toolbars, which I have created with similar code as above, are docked one below the other. If I hide all toolbar then this does not happen with Print command.
I will be grateful if you can help.
|
|
|
|
|
Hi all,
Use & with caption of controls in VC++2006, please tell me how can use it in VC++2005, becaoz i m using it but & with caption of control is not working in VC++2005.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi,
I need to make the desktop as parent for my dialog and it needs to be modal.can it be done?
Thanks
|
|
|
|
|
|
any sepcfic reason for doing it?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I am using a radio button of type int.
If it is type int how can I disable/enable and hide it.
If it is of CButton I can enable and disable it using GetDlgItem().EnableWindow.
I dont know how to do if it is of int type.
Thanks.
Regards,
Sunil Kumar
|
|
|
|
|
sunilkumar.d wrote: I am using a radio button of type int.
I didn't get that point.
sunilkumar.d wrote: If it is of CButton I can enable and disable it using GetDlgItem().EnableWindow.
You can disable radio buttons too by GetDlgItem().EnableWindow() . For instance,
GetDlgItem( IDC_RADIO1 )->EnableWindow( FALSE );
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
sunilkumar.d wrote: If it is type int how can I disable/enable and hide it.
If it is of CButton I can enable and disable it using GetDlgItem().EnableWindow.
Radio Button is a window you can still use GetDlgItem().EnableWindow, Radio Button is not int type; as MFC allows DDX_Radio function that manages the transfer of int data between a radio control group and a int data member of the parent class it seems to you that Radio button is of int type.
|
|
|
|
|
Are you at work on a Saturday? If yes, do you work on all Saturdays? Or are you at home, lazing around your computer with coffee and snacks? That rocks man... Me at office right now, with lots of work to be done. We have a release on Monday.
(On the brighter side of it, the work is interesting and that keeps me going. )
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
i tries to save my saturdays and sundays from work. wishes for successful release.
|
|
|
|
|
Thanks for the wishes man. I too try to separate work from my personal life. But, sometimes it just becomes impossible. [Me at office right now, am the only soul here, out of the 499 in this floor ]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hi all,
i m new in database,i m using a SDI type appliaction in VC++ 2005, and MS-Access Datase through ODBC.
i m add class using MFC ODBC Consumer,and add desired database and its table for code.
By default it is derived from CRecordset. here GetDefaultConnect() for default connection and GetDefaultSQL() is present.
i want to know that in GetDefaultConnect() the connection string or path of database present, if i run my application on other computer then it gives an error, can i change the path in GetDefaultConnect(),
i dont knoe how can use it.
please tell me what string i pass in GetDefaultConnect() for execute my application properly for each computer.
Thanks in advance.
I m waiting for ur Valuable suggetions.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
If the connect string varies depending on location the app is running
from, then you need to provide the correct connect string instead of
hard-coding the string.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Please tell me with example.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
GetDefaultConnect() is virtual. Simply derive a class from CRecordset
and override GetDefaultConnect() to return an appropriate string.
That's great for one recordset, but it's much easier to manage connections
with CDatabase - the class that actually represents the database connection.
You can have multiple connections (CDatabase Objects) so you can pool connections.
CDatabase MyDatabase;
BOOL ret;
try
{
ret = MyDatabase.OpenEx(myconnectionstring, CDatabase::noOdbcDialog);
}
catch(CDBException *e)
{
return;
}
if (ret && MyDatabase.IsOpen())
{
CMyRecordset myRecordset(&MyDatabase);
...
Data Source (ODBC)[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|