|
You asking "how convert pointer to string", or "how convert data ref by pointer to string" ?
And if data, you mast say what kind of data (unsigned short * pointer may point to Unicode string, WORD value, 16bpp raster data ....)
|
|
|
|
|
It is pointer to a Ascci string.
I have to display it in a message box.
So I have to convert it to CString.
|
|
|
|
|
simple (if there ASCII coded string )
CString((char *)data)
|
|
|
|
|
I got only the first letter???
|
|
|
|
|
That meens, that you have not ASCII data stored by pointer.
You mast know, what coding used (Unicode, MBS, BSTR, wide char), and corectly convert pointer to CString constructor.
|
|
|
|
|
Sorry I mistook .
It is pointed to BSTR.
|
|
|
|
|
|
It works!!!!!!!
Thanx a lot..
|
|
|
|
|
Neither MessageBox() nor AfxMessageBox() requires a CString object. You might consider showing us a relevant code snippet and we could probably offer a solution.
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
If the unsigned short * is really a BSTR or a _bstr_t then just do
CString(usp) . The CString constructor is overloaded to accept BSTR s
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Hi Friends,
I have about 10 machines where data from 10 different office locations is stored in MSDE. I have a centralized SQL server where I want to copy the data(8 tables) from other machines. How can I write a program which creates DTS package on the fly and copy data from all the 10 machines.
I could have DTS packages in all the 10 machines which updates data to the central server,but, assuming the structures are consistent accross all source machines(which is exactly in have right now in my application), why not
have a single package held centrally that I call against the different
sources. Sounds GOOD , BUT............
I want to create a Generic(customizable) DTS package which accepts 6 PARAMETERS
1. Source DB name
2. Source DB UserID
3. Source DB Password
1. Traget DB name
2. Target DB UserID
3. Target DB Password
So i expect to call the DTS package from my vc++ application using 'ShellExecute'.
So please help me create such a kind of DTS package(i shud be able to handle exceptions and Tranformation failure if anything should occur in the process)
Waiting for ur reply,.........
Regards,
Prax.
|
|
|
|
|
Hello. Ive asked this question before. Ive read tutorials, and looked online at google. The problem is, most of this assumes that you have knowledge of MFC, and programming with CDialog. I do not. Now I will present my problem. I have an ATM Gui type project. When I run this project, a dialog window pops up that has two buttons. These buttons are "Savings" and "Checking". When the "Savings" button is clicked, the Dialog window should SWITCH to the savings Dialog Window. This should also be the same for the "Checking" button. There is already a Checking and Savings class, and an ATM class, and each of them have their own Dialog Window. I have already used ClassWizard, and read tutorials, but I require some code. Anyone with knowledge in this area, anyone at all, I am begging for help. When I use class wizard, it makes two functions:
void CATM_gui1Dlg::OnChecking() <br />
{<br />
}<br />
<br />
void CATM_gui1Dlg::OnSavings() <br />
{<br />
}<br />
I Dont know what code to put in there to "invoke the other class dialog windows." That is my question, what would the code be, or the functions be, to switch to other Dialog Windows once the button is clicked?
Mike -- I Code Because I love to
|
|
|
|
|
search for GetOpenFileName() and GetSaveFileName() in the MSDN.
TOXCCT >>> GEII power
|
|
|
|
|
I seached in MSDN, and it told me what the functions do. Again, I am very new to all of this. What..would...the..code be so I could link the checking button to the checking dialog window, and the savings button to the savings dialog window. How would I use OpenFileName() and SaveFileName()?
Mike -- I code because I love to
|
|
|
|
|
<font color=#0000FF>void</font> CATM_gui1Dlg::OnSavings() {
<font color=#0000FF>char</font> strDestFile[260] = <font color=#808080>""</font>;
OPENFILENAME file;
<font color=#008000>
ZeroMemory(&file, <font color=#0000FF>sizeof</font>(file));
file.lStructSize = <font color=#0000FF>sizeof</font>(file);
file.hWndOwner = <font color=#0000FF>this</font>->m_hWnd;
file.lpstrFile = strDestFile;
file.nMaxFile = <font color=#0000FF>sizeof</font>(strDestFile);
file.lpstrFilter = <font color=#808080>"Text files\0*.TXT\0"
"All files\0*.*\0"</font>;
file.nFilterIndex = 0;
file.lpstrFileTitle = NULL;
file.nMaxFileTitle = 0;
file.lpstrInitialDir = NULL;
file.Flags = OFN_OVERWRITEPROMPT |
OFN_PATHMUSTEXIST;
<font color=#008000>
<font color=#0000FF>if</font> (GetSaveFileName(&file) == TRUE) {
<font color=#008000>
}
}
TOXCCT >>> GEII power
|
|
|
|
|
I think you're getting the wrong end of the stick - he's talking about a Savings dialog - i.e. a dialog for his ATM application that shows the user's financial savings (not a file save dialog)
--
Help me! I'm turning into a grapefruit!
Phoenix Paint - back from DPaint's ashes!
|
|
|
|
|
Do you want to keep the CATM_gui1Dlg window open, or do you want to replace it with the new dialog
To show another dialog, you need to
CSavingsDlg dlg;
dlg.DoModal();
Michael
CP Blog [^]
|
|
|
|
|
If the Savings and the Cheking class are derived from CDialog (which they should be...) then take a look at CDialog::DoModal(). This will show the dialog in a modal state. (Information found in MSDN)
If you want the ATM window to be invisible, then call ShowWindow(SW_HIDE) before the DoModal() call..
Hope this solves your problem.
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
not exactly, you cannot write into a CString with operator[]
TOXCCT >>> GEII power
|
|
|
|
|
hi,
I ve got a non MFC DLL that is aleady developped.. However, I d like to add this version window to my DLL. But I dunno how to do it.
I did create a ressource file that I have added to my project with the code of the ressource in it. But it doesnt make any difference. I came across a tutorial on the web to do this... but it used the STL, which seems a bit too far fetched to me.
I reckon this is not complicated and there is an easy way to do it, but this is always the same: it is easy once u've done it.
If somebody could help me out, would me nice
cheers.
bob
|
|
|
|
|
I am not sure what you mean by 'version window'
Do you possibly mean you want to add a version RESOURCE so that you can see the file version information when you get properties from Explorer, for example?
|
|
|
|
|
I have a ListCtrl with about 50 rows by 6 cols being updated every second. There is quite a bit of flicker and I have tried the following to reduce it:-
m_cSignalList.SetRedraw(FALSE); <br />
... <br />
... <br />
Update the items on the control <br />
... <br />
... <br />
<br />
m_cSignalList.SetRedraw(TRUE); <br />
m_cSignalList.Invalidate(); <br />
m_cSignalList.UpdateWindow();
Are they anything else I can do?
|
|
|
|
|
I think your only option is to make the control owner-drawn and draw to an off-screen bitmap and then copy it into the control's DC. That's a pretty big undertaking.
Try looking for a list control on CP that can do it for you.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Thanks, I will have a look.
|
|
|
|
|
Just curious, but are the calls to Invalidate() and UpdateWindow() necessary?
"Opinions are neither right nor wrong. I cannot change your opinion of me. I can, however, change what influences your opinion." - David Crow
|
|
|
|