|
I don't think there is possibility to do something like you want at runtime. Besides what if number of strings you want to pass to the function==10,100 or more?? Do you really want to define function like: AddItem("one","two",.........................."ten"..."hundred)?
I think this is very bad idea. Why don't you choose my solution which I gave you earlier?
If you want to use char instead of string you can do this like this:
char **StrArr;<br />
int Size1=30,Size2=10
StrArr= new char*[30];
<br />
for(int i=0;i<30;i++)<br />
StrArr[i]=new char[Size2];
after this you can write strings into Str[][] array and pass whole array into function giving the Size1 and Size2 as additional parameters near the parameter: char **StrToPass
If you want to use your idea you can do something like this for lets say finite and small set of strings, use "default parameters" (I don't know if I call this properly in English):
void function (char *Str1="",char *Str2="",char *Str3="",char *Str4="") <br />
<br />
function("blablaba");
|
|
|
|
|
Maybe I'm misunderstanding the question, but can't you just pass a reference or pointer to
a CStringArray?
OnButtonSubmit()
{
int count = GetItemCount();
CStringArray strArr;
for(int index=0;index ...
{
strArr.Add(db.GetColumnValue(index));
}
AddItem(strArr);
}
AddItem(CStringArray &strArr)
{
for (int i = 0; i < strArr.GetCount(); ++i)
{
}
}
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
how to make a mfc program autorun
|
|
|
|
|
[Autorun]
open=YourMFCApp.exe
What's wrong with this?, Btw is that you Jeepo?
-- modified at 6:01 Saturday 10th March, 2007
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
this will popup a window and make user to select the exe. but what i need is to execute the exe when i insert the drive no need for the pop up window
|
|
|
|
|
This is not something you can control. Autorun is a feature which users can select to disable or automate from within the OS. This is a security feature for the user.
|
|
|
|
|
ok but i have to do that for my project. can you please help me to achieve that. how can i do this
|
|
|
|
|
I just told you that you can't do it.
|
|
|
|
|
what about shelexec project
|
|
|
|
|
I will say it again, autorun is a feature of the OS. The the user does not want programes to autorun then he/she may disable the feature. The only way you can change this is to edit the registry. Changing this setting without the users permission is bad programing and borderline on being a virus.
|
|
|
|
|
So, you asked it from your other id?
|
|
|
|
|
Hi friends
Is any solution to send email without using smtp server
KK
|
|
|
|
|
Did you see Internet section(Email) on the codeproject?
|
|
|
|
|
I have placed autorun.inf file inside the drive.when i insert the drive the popup window will appear.then double click the icon ,the autorun exe file is executed.
I want to execute file automatically when insert a drive without user interaction.is it possible?
How to do this ?
Any software is needed to install?
|
|
|
|
|
What you have written in your inf file?
Nice talking to you.
If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
i have written as
[autorun]
open=boot\EKLoader.exe
Action=ENCRYPTAKEY
label=WELCOME TO ENCRYPTAKEY
icon=boot\ek\ico.ico
shell\ek="&ek" shell\ek\
command=ba.bat
now what i need is i have to straightly run the EKLoader.exe file without asking user intention to click the exe
-- modified at 4:12 Saturday 10th March, 2007
|
|
|
|
|
Hi,
In my windows-xp cd's inf file the code is as follows.
[AutoRun]
open=setup.exe
icon=setup.exe,0 I hope your cd must works. But is your OS windows XP or higher?
If your os is NT/2000/98 then i am not sure about that cd runs automatically. please check once. I am not much aware of this scripting. If my answer is not helpful, If you searching in scripting zone you could get proper answer.
Thank you,
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
this will popup a window and make user to select the exe. but what i need is this wolud itself start running the exe instead of popping up the window.
|
|
|
|
|
My windows xp cd is haveing the code which i posted here only. But my xp cd is working fine. I just inserted this cd, I never selected the exe. Automatically CD is running.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
i am using usb. but its not working. can you help me
|
|
|
|
|
Hi you may need to see the settings of your OS. Please check that once. see the message above posted by Mr.Prathuraj once.
prathuraj wrote: This is not something you can control. Autorun is a feature which users can select to disable or automate from within the OS. This is a security feature for the user.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
hi
I have added one vc++6.0 dll in my vc++.net MDI application for that I set Used Managed Extensions proerty to true,
now it will not allow me to create list and give exception when try to create list with code given bellow
CLayerListCtrl *lstCrtl = new CLayerListCtrl();
lstCrtl->Create(WS_CHILD|WS_VISIBLE |LVS_REPORT |WS_BORDER | LVS_NOCOLUMNHEADER ,rectListEx,this,0);
can anyone help me
Thanks,
Rushiraj.
|
|
|
|
|
rushiraj.jhala wrote: it will not allow me to create list and give exception when try to create list
What type of exception it is ?
|
|
|
|
|
hi
I have one VC++.net MDI project, it was working fine befour i have import one function from vc++6.0 dll using p/Invoke and dllimport.
now it is gicing me execption given bellow
An unhandled exception of type 'System.TypeLoadException' occurred.
can any one tell me how to overcome this problem.
Thanks
Rushiraj
|
|
|
|
|
How to change the hidden property of a folder through code?
Plz help..it's urgent
Thanks..
|
|
|
|