|
Hi,
I have a requirement to open a .net application from within a C++ application. Can anyone of you please help me in this regard.
Thanks in advance.
Siva.
|
|
|
|
|
What do you mean by open an application?
If you want to execute a .NET executable, you can do so using CreateProcess .
If it is a DLL that you want to load, you will have to create a COM Callable Wrapper (CCW) for your .NET application and then use it within C++ just like it is a COM component.
Please refer to the documentation on CCW.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
if you have the binary you can use ShellExecute and for finer control use CreateProcess.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hi everybody
In my application i want to receive some data and after reeving the data i have to perform some operation.
For the data to come it will take some 0 to 3 sec.
So i am using Sleep(3000) to wait the data to come.But some times the data will come in less than 1 second.So unnecessary i have to wait.
Before i was using this algorithm
While(dataHasNotCome)
{
//wait
}
But it failed as the data may not come sometimes and be in infinite loop.
I can use a counter and increment it till a particular value and stop the loop.
Other than that is there any other method.
Regards
Deepu
|
|
|
|
|
You can use asynchronous read here.
Since you have not mentioned how you are reading data, I will assume you can use the file manipulation functions on some sort of handle or you are using sockets.
If you are accessing a handle can use ReadFile or ReadFileEx with an OVERLAPPED structure.
For sockets you can use WSARecv function with an OVERLAPPED structure.
After calling the function you can wait on the event handle inside the OVERLAPPED structure.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
I am reading data from the COM port.It is happening in a thread and it keep on reading the data and this data is stored in one CMainFrame variable.
My part is to get this variable in my class and do some manipulations after the data has come.
The only thing i have to do is to check the data has come or not.
|
|
|
|
|
Open the port with the overlapped flag.
CreateFile(_T("COM1"), GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);
Post the asynchronous read.
OVERLAPPED over = { 0 };
over.hEvent = ::CreateEvent(0, 0, 0, 0);
DWORD dwRead = 0;
ReadFile(m_hPort, buffer, len, &dwRead, &over);
Wait on the event for 3 seconds.
if (WAIT_OBJECT_0 != WaitForSingleObject(over.hEvent, 3000))
return;
GetOverlappedResult(m_hPort, &over, &dwReade, 0);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
Why don't you register a callback in the module where data is rcvd. and call that callback as soon as (dataHasCome)
|
|
|
|
|
Reading on a COM-Port is fine be reading 1 (in words: "one") byte while waiting for completion (or time out)
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Where does the data come from? For most input devices, there is some way of blocking until the input device has some data, rather than having to sleep.
But we can't help you if you don't give us that detail!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Assuming your data is coming via the serial port, read here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Is that a IWebBrowser2 wrapper class ? Check this site[^] for more information.
Also, please look at the Navigate[^] method.
|
|
|
|
|
Hi,
I am trying to size my Rich edit Dialog box to fit a certain amount of characters on a line of Multiedit Rich Edit control
It would be helpfull to know logfont Height and long font width
I have tried in My Initdialog rtn to get this info
by dointg CFOnt * CRichEdit::GetFont however it seems the the Font has'nt been set as yet
GetDegaultCharFormat doesn't return any size info I know the CharFormat structure doesn't have a Width members
but the hieght is zero
Maybe becuase I haven't sized My Edit Control via MoveWindow
would anyone know when (maybe somne message e.g. WM_SETFONT) that rich edit populates the Height/Width of the font
thankx
|
|
|
|
|
The documentation[^] says:
The return value is a handle to the font used by the control, or NULL if the control is using the system font
I suspect the system font is being used, in which case GetStockObject(SYSTEM_FONT) should return the required font handle?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I just wonder Height and width fields have something else besides zeros
As I would like to use the width to size up number characters I can have on a line
I'll try it out
thankx
|
|
|
|
|
This code in my OnInitDialog:
CFont* f = richEd.GetFont();
if (!f) f = CFont::FromHandle((HFONT)GetStockObject(SYSTEM_FONT));
LOGFONT lf;
f->GetLogFont(&lf);
yields
lf.lfHeight = 16
lf.lfWidth = 7
when the rich-edit is (presumably) using the stock font.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
thznkx so so so so so much ............
The Rich Edit control in my resource file is sizes are all zeros (0,0,0,0) as I plan to size
it myself Hope it wont effect hiegt and width
I'll give it a shot
thankx again
|
|
|
|
|
|
ForNow wrote: I am trying to size my Rich edit Dialog box to fit a certain amount of characters on a line of Multiedit Rich Edit control
So do you need GetOutputTextExtent() or GetTextExtent() for this?
While it makes sense to limit an edit control to only allow a certain number of characters, is there any real benefit in sizing an edit control so that it is just wide enough to hold N characters?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
My rich edit control sizes defined in my resource file is all 0,0,0,0 zeros
In Accordance with Rich Edit Bottomless edit control concept
the width from either GetDefaultCharFormat or From GetLogfont is zeros
I look up the Api's you have been kind enough to show me and use the width as a starting point
in sizing my edit control
thankx
|
|
|
|
|
Thankx for everybody help
GetTextExtent seems to be my best bet
though I beleive the size will change with a MoveWindow
guess I'll try it and see
|
|
|
|
|
I have a necessity to Remotely upload the PDF documents to the SharePoint Server. Can I do this task with VC++ 6.0 IDE. As per my knowldge I can do this consuming the SharePoint Webservices and using VC++ 2008 IDE with DotNet Framework support.
|
|
|
|
|
Sharepoint web-services use SOAP, right? In that case, gSOAP[^] would probably be the best thing to generate C++ bindings compatible with VC6, I suspect.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|