|
Wow thanks so much! I did have to change 1 part of what you suggested to get it to work (No ^ on the 1st param) but now I am so happy. I had wasted so much time on this problem. I didn't know about the InteropServices namespace before. I'll have to read up on it.
public:
virtual void DoThis(String title, [System::Runtime::InteropServices::Out] Object^% valueToChange) override;
Thanks,
-Darryl
|
|
|
|
|
I want to erase the contents of a progressbar and I save not what is the methode? I performed the progressbar with progressBar1->PerformStep();, i work with winforms
|
|
|
|
|
You could set Value to 0.
|
|
|
|
|
|
abbd wrote: How set to 0 ?????
progressBar1.Value = 0;
|
|
|
|
|
Set the ProgressBar.Value property to 0?
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
I have developed a text editor supporting international languages.
One problem still bother me: The location of the IME window.
When I have an asian user entering asian characters, (s)he does so through an IME window which is located in a seemingly unpredictable/uncontrollable location.
Is there a way I could set the location, size, and font (or at least font size) used by this IME window?
How could I know when it is used or not?
|
|
|
|
|
I would use listView, but i don't know how ican add 2 item i try:
istView1->Items->Add(cli::array<string^>^ tabChaine = {"Element 1", "Element 2"});
but there are errors,Thank you
|
|
|
|
|
What are the errors?
I don't see a ListView.ListViewItemCollection.Add overload that takes a "cli::array^" as an
argument.
Also managed object references don't work like C++ pointers so this won't work:
cli::array^ tabChaine = {"Element 1", "Element 2"}
Have you seen the example code here[^]?
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Mark Salsbery wrote: Also managed object references don't work like C++ pointers so this won't work:
cli::array^ tabChaine = {"Element 1", "Element 2"}
However, the below code works but not in the context our friend was using it in.
array<String^>^ items = {L"Hello", L", ", L"world!\n"};<br />
<br />
for each (String^ item in items)<br />
{<br />
Console::Write(item);<br />
}
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
wow. I need to move to VS 2005
Thanks!
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
Hey guys, it has been a while /cry. I seem to be having some issues with comparing values in a file, such as finding the highest value in a file in mixed order and outputting to a file in correct order. I have a file created with the following text 4,3,1,2, my object is to find the highest value then output to a file in correct orsder to 1,2,3,4. This is all I have and I am a little rusty cause it has been a while:
// iofilecomp.cpp : Defines the entry point for the console application.
// iofilecomp.cpp : Explains how to copy the contents from one file to another.
//
#include "stdafx.h"
#include <conio.h>
#include <string>
#include <fstream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
ifstream ins; //reads from file
ofstream ous; //writes to file
ins.open("in.dat");
ous.open("ou.dat");
string line;
if( ins.is_open )
{
while ( ! ins.eof() )
{
getline(ins, line);
cout << line << endl;
}
ins.close();
}
else cout << "Unable to open file.";
ous.close();
_getch();
return 0;
}
The above will only output in the order read from the file. Possibly could I get some assistance or pointed in the right direction please. Thank you.
|
|
|
|
|
Probably, you can ask this in right forum. VC++[^] in this case.
|
|
|
|
|
Sorry I am unfamiliar with the sort/vector function i was hoping something a little more basic something like using the if do func, I just need to get either the lowest value first or the highest value first then start comparing. How would I go about find the highest/lowest value in a file.
|
|
|
|
|
I guess you didn't understand prasad_som! This is the wrong forum to ask a Native C++ question. You need to go to the Visual C++/MFC forum to ask your question. This is the (MANAGED) C++/CLI forum.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I would create an executable who can run in any computer, I work with WinForms
Thank you very mutch
|
|
|
|
|
You would like to create a managed C++/CLI executable using Windows Forms that can run on any computer?
No, you cannot create such an executable.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I use Windows Forms Application and i would execute an another application like a Word file, i try ShellExecute; But there are errors, i write :
ShellExecute(0,'OPEN','C:\Documents and Settings\abbd\Bureau\App2.0\Ids 0.0\Ids 0.0\az.doc',Nil,Nil, SW_SHOW);
error C2015: too many characters in constant
error C2065: 'Nil' : undeclared identifier
error C2065: 'SW_SHOW' : undeclared identifier
error C3861: 'ShellExecute': identifier not found
Please help to execute this file, thank you.
|
|
|
|
|
Since you are using .NET, you should use Process::Start
|
|
|
|
|
abbd wrote: error C3861: 'ShellExecute': identifier not found
That error indicates you don't know how to #include header files for C++ development. The fact that you don't know that indicates that you need to step back to student mode and learn some prerequisite programming topics before you try to write working windows applications.
led mike
|
|
|
|
|
first of all the type of formas application you need is.... CLR Windows Forms Aplication
create a process outside the namespace.. and use these headers..
#include string
#include windows.h
#include process.h
using namespace std;
unsigned __stdcall execplz(void *params);
string cl;
somewhere in your program you need to place the following line to execute the command;
<br />
unsigned sID; (HANDLE)_beginthreadex( NULL, 0, execplz, NULL, 0, &sID);<br />
and keep in mind the command line string is std::string cl;
which i have set as global string at top so you can use anywhere..
the process below will create a process invisibly to yours ok.. so
to change that you need to remove... si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
<br />
unsigned __stdcall execplz(void *params){<br />
string fnn;<br />
int nLen = cl.length();<br />
bl=cl; std::string::size_type idx; idx=bl.rfind("\\");<br />
bl=bl.substr(idx, string::npos);<br />
cl=cl.substr(0, idx-1);<br />
int nLeng = bl.length();<br />
<br />
LPWSTR szCmdLine = new WCHAR[nLen+1];<br />
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,cl.c_str(),nLen,szCmdLine,nLen);<br />
szCmdLine[nLen] = '\0';<br />
<br />
LPWSTR fnonly = new WCHAR[nLeng+1];<br />
MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,bl.c_str(),nLeng,fnonly,nLeng);<br />
fnonly[nLeng]='\0';<br />
<br />
STARTUPINFO si;<br />
PROCESS_INFORMATION pi;<br />
GetStartupInfo(&si);<br />
si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;<br />
si.wShowWindow = SW_HIDE;<br />
ZeroMemory( &si, sizeof(si) );<br />
si.cb = sizeof(si);<br />
ZeroMemory( &pi, sizeof(pi) );<br />
<br />
if( !CreateProcess( szCmdLine, fnonly, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi) ) { printf( "CreateProcess failed (%d).\n", GetLastError() ); }<br />
return 0;<br />
}<br />
ok so the reason why i have this a separate process.. is because its using threads..
you can use this at anytime even when soemthing else is going on..multiple times at once
if wished.. good for creating webservers and such...
-- modified at 5:26 Saturday 10th March, 2007
|
|
|
|
|
I trvail with Windows Forms application, when I click on Form1.h in Solution Explorer an error arrive:
Requested registry access is not allowed. <br />
Hide <br />
<br />
at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)<br />
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)<br />
at System.Diagnostics.EventLog.GetEventLogRegKey(String machine, Boolean writable)<br />
at System.Diagnostics.EventLog.Exists(String logName, String machineName)<br />
at System.Diagnostics.EventLog.OpenForRead(String currentMachineName)<br />
at System.Diagnostics.EventLog.get_EntryCount()<br />
at System.Diagnostics.EventLog.StartListening(String currentMachineName, String currentLogName)<br />
at System.Diagnostics.EventLog.EndInit()
Knowing that i introduced in Begining:
using namespace System::Diagnostics;<br />
using namespace System::Threading;
But before this work, and Form1.h opens normally, when I click on Form1.h the interface of my project which cames but there are error.
Thank you
|
|
|
|
|
Looks like you are running as a low-privileged user. Try running as administrator (or a non-admin higher-privileged user).
|
|
|
|
|
Where i can fin this? in Proprities?
Thank you very mutch.
|
|
|
|
|
abbd wrote: Where i can fin this? in Proprities?
I am talking about the Windows logon user here. You'd have to change user permissions from the control panel. The exact applet to do that would depend on your OS.
|
|
|
|