|
A good candidate for the subtle bug forum...
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
From an dialog based win32 app I awant to load a menu in the dialog. How to do that?
|
|
|
|
|
See LoadMenu On MSDN it has examples that I think its helpful for you
|
|
|
|
|
Hi, How do I make dynamic array of String class in VC++? Thanks in advance. Priyank
|
|
|
|
|
use std::vector<std::string>
don't forget to #include <VECTOR> and <STRING>
|
|
|
|
|
Depending on what you want to do with the String, and weather it doesn't matter if they get copied or not you should use std::vector<std::string::reference> i guess.
-- modified at 8:29 Friday 10th November, 2006
|
|
|
|
|
Mr.Brainley wrote: ...you should use std::vector i guess.
Which is exactly what toxcct suggested.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Inserted html code "<" now. Now it makes sense - i hope.
|
|
|
|
|
Actually I want to make two dynamic arrays of String and then need to do some comparison with each other. I made vector of String class and tried to push_back methode to add string to it but it gives me error like “cannot convert from 'System::String __gc *__gc * ' to 'System::String __gc ** ' Cannot convert a managed type to an unmanaged type”
My code is
vector<String*> strArr;<br />
strArr.push_back("string1");<br />
strArr.push_back("string2");
can I know what is the problem with my code?
Thanks
|
|
|
|
|
priyank_ldce wrote: vector strArr;
strArr.push_back("string1");
strArr.push_back("string2");
can I know what is the problem with my code?
How about:
vector<String*> strArr;
strArr.push_back(new String("string1"));
strArr.push_back(new String("string2"));
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: How about:
vector<string*> strArr;strArr.push_back(new String("string1"));strArr.push_back(new String("string2"));
I tried it. It gives same error I am writing full error message here.
error C2440: '=' : cannot convert from 'System::String __gc *__gc * ' to 'System::String __gc ** '
Cannot convert a managed type to an unmanaged type
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\vector(579) : while compiling class-template member function 'void std::vector<_Ty>::push_back(System::String __gc *const __gc & )'
with
[
_Ty=System::String __gc *
]
eAssessment.cpp(20) : see reference to class template instantiation 'std::vector<_Ty>' being compiled
with
[
_Ty=System::String __gc *
]
And this is under push_back methode.
|
|
|
|
|
This is a Managed C++ issue, of which I am very unfamilar. Try here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
If this is managed code (you didn't mean to use CString instead of String) then you should
probably use one of the classes in System.Collections namespace instead of a vector.
Check out ArrayList and Queue classes.
|
|
|
|
|
Hi... I have a small program running (MS VC++ 6.0 on Windows XP Prof) with starts an other one
using CreateProcess. But now I need to start the other programm under a different user account.
I need to use a fixed username and password which the user should not know.
Does anyone can tell me how to use CreateProcessAsUser with username und password?
Thanks
Stefan
|
|
|
|
|
i have 2 questions :
1) how can i retrieve this string if is not find in my database ?
because i now if is find ...!
int nIndex = pBun->m_cont.Find(pMainSpace->m_sTextDatabase);
if ( nIndex != -1)
{
m_debit.SetWindowText(pBun->m_den);
break;
}
2)how can i send 1 string from a CDialog to another ?
i have 1 CEdit in CDialog 1 and 1 CEdit in CDialog2,
i whant to write some txt in CDialog1 ->CEdit1 and when i push the button DoModal CDialog2 i need the txt in CDialog2->CEdit2
see you soon !
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: 1) how can i retrieve this string if is not find in my database ?
because i now if is find ...!
If it's not in the database, how/where would you find it?
I don't see your question too clear or may be I didn't understand your need or what you are trying to do.
Bravoone_2006 wrote: 2)how can i send 1 string from a CDialog to another ?
You can do
CMyFirstDialog* pMyFirstDlg = (CMyFirstDialog*)GetParent();
to get a pointer to the first dialog in the second one and then access member functions etc to get the value's from the first dialog into the second one.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Bravoone_2006 wrote: 1) how can i retrieve this string if is not find in my database ?
You can't. Why would you think a string could be retrieved from a database when it cannot be found?
Bravoone_2006 wrote: 2)how can i send 1 string from a CDialog to another ?
void Dialog1::OnButtonClick()
{
Dialog2 dlg;
dlg.SetValue(some_str_value_from_edit1);
dlg.DoModal();
}
void Dialog2::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_EDIT2, m_ebEdit2);
}
Dialog2::SetValue( LPCTSTR lpszStr )
{
m_str = lpszStr;
}
BOOL Dialog2::OnInitDialog()
{
CDialog::OnInitDialog();
m_ebEdit2.SetWindowText(m_str);
return TRUE;
}
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
After using a _AnShUmAn_ answer use of pMyFirstDlg->yourvariable or function (you need to include header file to another file)
|
|
|
|
|
I am doing an application using ATL COM application wizard.I want to get the path name of the current application .How can i get it.
Thanks.
|
|
|
|
|
radhika28 wrote: I want to get the path name of the current application
Doesn't GetModuleFileName using _module.hInst help ?
|
|
|
|
|
ya the above will retrive the path from exe file.But i want to retrive the path without using executable.Is it possible?
Thanks.
|
|
|
|
|
Do you mean folder path containing exe ?
In that case why dont you trim exe name ?
|
|
|
|
|
In my ATLCOM application i am giving the executable path as C:\windows\explorer.exe.But my application is in D drive.How to retrive the path of the my application in D drive i.e D:\.....
Thanks.
|
|
|
|
|
Have you tried what I said earlier ? It will give path of dll. Provided you pass module instance to it.
If you pass NULL as first parameter it will give exe path.
From MSDN :-
Parameters
hModule
[in] Handle to the module whose file name is being requested. If this parameter is NULL, GetModuleFileName returns the path for the file containing the current process.
|
|
|
|