|
use explorer control and assisgn any link to it
|
|
|
|
|
actually one thing I missed. My VC++ code is unmannaged. So how can I do that then ?
I think may be problem is something else?
Azhar Rahi
modified on Sunday, January 11, 2009 4:14 PM
|
|
|
|
|
Hi guys,
I been working on a antivirus project as my final year project.. i have some problem with getting the list of all the files in a directory..
Lets say i choose C:/ and i want the list of all the files in the directory. Kindly help me with this ya... its a console program and i using DavC++ compiler...
Regards,
Thilek
|
|
|
|
|
This is the C++/CLI (Manage C++) forum. You need to ask your question in the C++ / MFC forum.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I want to Invoke a Web Service using Visual C++ .NET. Please provide me with information.
I have sample code to invoke web service using c#. The web service method has complex data as input. Please reply.
|
|
|
|
|
If you have sample code, why not convert it to C++/CLI?
Or just use C#?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Here[^] and here[^] as well, pick a forum and stick to it!!!
|
|
|
|
|
ok.fine. Tell me how to invoke web service using managed c++ (in .NET 2003/2005)
|
|
|
|
|
Hello everyone, I'm relatively new to writing code in C++ and I've been running into a problem. You see, I got a chunk of code off the internet for use in my program and it includes:
using namespace System
But the compiler doesn't like it. From what I can tell it isn't declared in the body of the code and it sounds rather like a predefined namespace. Is there something I need to include to fix this or what? Thanks in advance
|
|
|
|
|
linkfitz wrote: But the compiler doesn't like it.
How do you know this? It would be helpful to see the EXACT error message
(or a transcript of the conversation you had with the compiler if it was verbal).
The System namespace is part of the .NET framework so to start with you'll need
to compile the code for C++/CLI. Then at the very minimum, your project will need a
reference to the .NET framework System DLL.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hey i'm building a drawing app (actually from book) and now I want it to don't flicker, everytime i draw something or move mouse (for highlighting drawings) it need to be redrawn. So how to lessen the flickering?
Can this be gone with multithreading?
modified on Tuesday, January 6, 2009 10:09 AM
|
|
|
|
|
Multithreading probably won't help flickering since generally UI operations
have to be done on the same thread.
One way to minimize flickering is to only redraw an area that changes.
A better way to eliminate flickering is to use double buffering -
do your drawing to memory and then render the finished drawing to the screen.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I concur with Mark, multithreading typically will not help.
Most of the flickering is due to the fact that things get erased (or background painted) before the foreground gets painted, so your drawing is absent for a while. This is most noticeable when there isn't much calculation going on, i.e. as soon as the painting is done, a new cycle starts with erasure and repaint, erasure being the faster of the two.
Here is what improves the behavior:
- increase the painting performance by optimizing the code; e.g. avoid creating and disposing objects in your Paint method, use the Graphics from PaintEventArgs (don't use CreateGraphics), keep your Fonts, Pens, Brushes in class members, etc.
- only repaint what needs repainting, use the clip rectangle to determine whether each part of your drawing needs a repaint before painting it;
- set your Form, Panel, or whatever Container is relevant to DoubleBuffered; when
double-buffered the container does not erase, it just overpaints what is already in place.
- possibly, depends on your needs: limit the repaint frequency; rather than repaint (i.e. call invalidate) for every mouse movement, maybe set up a Forms.Timer to repaint at a fixed frequency of say 10Hz.
FWIW: when you need to track mouse movements (say some rubber banding stuff) there is a ControlPaint class that supports this, however it is not very easy to use it correctly since it can paint outside your container, so when another Form overlaps your container it could disrupt that Form's content.
modified on Tuesday, January 6, 2009 12:40 PM
|
|
|
|
|
Hi
I have a code sample in C# where the user has created a delegate and while calling BeginInvoke it passes an instance of ASyncCallback object with the function to be called when the asynchronous function returns. However when i try to do something similar in Managed C++ the delegate object doesnt have a BeginInvoke function. Moreover if I use the BeginInvoke of the windows form instance the argument list of the overloaded BeginInvoke function doesnt shows the ASyncCallback argument.
Anybody has any idea why the difference in delegates in C# and Managed c++ and why ASyncCallback argument is not available in BeginInvoke for Managed C++.
Thanks
gsm
|
|
|
|
|
gurindersm wrote: I have a code sample in C#
Can you show the sample?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
Sorry for the delay...
here is the code snippet from the C# sample.
IAsyncResult ar;
// Define a delegate for the ReadReport method.
ReadReportDelegate MyReportDelegate = new ReadReportDelegate(ReadReport);
// The BeginInvoke method calls ReadReport
// The method has the same parameters as the ReadReport function,
// plus two additional parameters:
// GetInputReportData is the callback procedure that executes when the ReadReport function returns.
// MyReportDelegate is the asynchronous delegate object.
// The last parameter can optionally be an object passed to the callback.
ar = MyReadInputReportDelegate.BeginInvoke
( hRdHndl,
hRHndl,
hWndl,
ref devD,
ref ReportBuffer,
ref Success,
new AsyncCallback(GetInputReportData),
MyReportDelegate );
Thanks
gsm
|
|
|
|
|
I don't have your ReadReportDelegate class, but here's an example of
the basic pattern
public ref class SomeClass
{
public:
delegate void MyDel(int a, int b);
void MyDelFunc(int a, int b)
{
}
static void MyAsyncCallback(IAsyncResult ^result)
{
SomeClass^ This = (SomeClass^)result->AsyncState;
...
}
void MakeAsyncCall(void)
{
MyDel ^MyDelegate = gcnew MyDel(this, &SomeClass::MyDelFunc);
int a = 1;
int b = 2;
MyDelegate->BeginInvoke(a, b, gcnew AsyncCallback(MyAsyncCallback), this);
}
Everything's identical to C# except the usual language syntax differences
(^ for object references, gcnew instead of new, -> instead of ., etc.).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thanks Mark ..
I think i should have just compiled my code instead of going through all the member function of the delegate i created in my program.
By the way do u see BeginInvoke as a member function, i can see it in C# but not in C++. Although the code compiles and works absolutely fine.
Thanks
gsm
|
|
|
|
|
gurindersm wrote: By the way do u see BeginInvoke as a member function, i can see it in C# but not in C++.
I can see that in VS2008 and not on 2005. Strange!
|
|
|
|
|
I am working on VS2005 may be thats the reason I didnt see it....
Thanks
gsm
|
|
|
|
|
gurindersm wrote: By the way do u see BeginInvoke as a member function
Intellisense you mean? I can see it there on VS 2008 (C++).
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi..
i have an application(i.e. an access control system).. im asked to use tcp/ip to collect the information from the application when there is access violation... can some one temme how to proceed with this.. and after getting the instance of access violation, im supposed to pass the information to another application(written in c++) to take an action(record the event from a cctv where it is happening)..
do some one have any idea regarding this...
|
|
|
|
|
What was wrong with this[^]?
|
|
|
|
|
i want to connect my SQL server 2005 data base through c++ code.. please soem one help me..
more precisely, when ever there is a update in the data base i have to pass the values of the field to another application thru c++ code..
|
|
|
|
|