|
Dear All,
Please send me code snippet, tutorial or anythings which discribe how to use microsoft reporting service technology to generate reports within vb.net....? Thanks before.
|
|
|
|
|
|
Hi All,
I am building VB.NET web form application which access Web Service. I am wondering why the VB.NET send two packets to request the to the web service.
First packet:
POST /webservice/webservice1.asmx HTTP/1.1
SOAPAction: "http://webservice1/insUserName"
Content-length: xxx
Expect: 100-continue
Host: 192.168.1.1
Response from the web service:
HTTP/1.1 100 Continue
Date: ...
Second packet:
<xml version="1.0" encoding="utf-8">
Response from the web service:
HTTP/1.1 200 OK
...
I am wondering if there is a way that this packet can be just one packet,
such as:
POST /webservice/webservice1.asmx HTTP/1.1
SOAPAction: "http://webservice1/insUserName"
Content-length: xxx
Expect: 100-continue
Host: 192.168.1.1
<xml version="1.0" encoding="utf-8">
I am using VS 2003 with .NET 1.1
Thanks and best regards,
Riwan
|
|
|
|
|
I am trying to implement double buffering in a form, and I am getting a crash. I have a fix for the crash but I don't know if it's "correct".
To enable double buffering, I call this function from the form's constructor:
System::Void enable_double_buffering()
{
using System::Windows::Forms::ControlStyles;
SetStyle(static_cast<ControlStyles>(ControlStyles::DoubleBuffer |
ControlStyles::UserPaint |
ControlStyles::AllPaintingInWmPaint),
true);
UpdateStyles();
}
My Paint handler looks like this:
System::Void PlotDisplayWindow_Paint(System::Object* , System::Windows::Forms::PaintEventArgs* e)
{
using System::Drawing::Graphics;
Graphics* g = e->Graphics;
g->Dispose();
}
If I do not enable double buffering, then it works fine, but with flickering. With double buffering, I get the following exception:
************** Exception Text **************
System.ArgumentException: Invalid parameter used.
at System.Drawing.Graphics.EndContainer(GraphicsContainer container)
at System.Windows.Forms.DibGraphicsBufferManager.ReleaseBuffer(GraphicsBuffer buffer)
at System.Windows.Forms.GraphicsBuffer.Dispose()
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
If I comment out the g->Dispose(); line in the Paint handler, then I do not get the crash. Is it correct/acceptable not to dispose of the Graphics object after painting?
--
Marcus Kwok
|
|
|
|
|
ricecake wrote: If I comment out the g->Dispose(); line in the Paint handler, then I do not get the crash. Is it correct/acceptable not to dispose of the Graphics object after painting?
General rule is you should not be calling Dispose on objects that you didnt create
|
|
|
|
|
leppie wrote: General rule is you should not be calling Dispose on objects that you didnt create
Yeah, looking back on it I think the call to Dispose() was an artifact of when I tried to use threads and CreateGraphics() .
--
Marcus Kwok
|
|
|
|
|
Hi all,
Is there a possibility to detect in code (console application) if IIS supports asp.net? (only detect, not fix the problem)
There is a case when you install first the .net framework and after that install the IIS server, so the .net is there but IIS does not know that and .aspx is not working.
Does anyone heave a code sample that can do this detection?
Thanks,
Dinu
|
|
|
|
|
Hi.
I'm coding a c++ dll with visual studio 2005 and in my project configuration properties, the Common Language Runtime Support is set to "no".
What I want is to get executables which may run in every windows machine without the need of the .NET framework, and I was wondering if I'd need another IDE to do that.
Also I'm having problems mixing up a VB 6 program which uses a c++ dll compiled with vs2005. When I run the vb executable, it holds in the process list once it's close. Nevertheless, if I compile the same VB code with vs2005 and use it with the same dll, it all works like a charm.
If you don't know the answer, clues and tips are also welcome.
Thanks in advance.
|
|
|
|
|
I don't know about VS 2005, but in 2003, there are project types in the C++ folder for ATL, MFC and Win32. Pick one of those and your application won't depend on the .NET runtime. Programmer beware: just about anything fun needs at least one external DLL linked in, and you need to ensure that those libraries are on the target client yourself. MFC requires a runtime DLL, and I'd guess ATL does too (not sure, though). If you're trying to avoid dependencies, write pure Win32, and refer heavily to Petzold.
As for the VB6/C++ project you have, if it's not unloading itself it's highly likely that your C++ DLL is leaving a thread running. Look through your C++ code for anything that's creating threads or any dependencies that may be (external libraries often do this for polling, async I/O, etc.). Make sure they're giving back the threads when the message loop for the application dies.
Stephan
|
|
|
|
|
Hi, everybody. I have to make a report with FastReport. I have a distributive for Borland CBuilder, but I don't want even install it. Today I was said that there is FastReport for .Net. If anyone hear about it please send link where I can download it and where I can read some info about FastReports.
Thanks
|
|
|
|
|
looking for wumpus1 to awnser some led sign questions on the betabrite sign
-- modified at 22:07 Thursday 25th May, 2006
|
|
|
|
|
Hi,
Can anyone explain me the internals of GC in terms of generations,freachable queues and the algorithm involved!
Thank you!
Deepa!
Be the Change you want to See!
|
|
|
|
|
|
Is there a way to customize the DataGridView ColumnHeaders?
I mean, make them look gradient or something like that?
|
|
|
|
|
I work on a web service project. Now, it has a 3rd part service which I must ask for data regular time on my own. How can I make a regular request at my server which is running the web service?
One way is I create a window service to ask the 3rd part datas at regular time, and if has datas then the window service send a request to the web service in order to transmit the receive datas to web service. I do not like this way, cuz it must create more service. How can web service send a request on it's own?
=== Interest is power! ===
|
|
|
|
|
If MS BizTalk is already a part of you existing solution - you may use it to perform periodic calls to 3rd party web service.
Otherwise - creating simple Windows service seems like a reasonable solution to me. Implement a service which will call 3rd party web service with the given period of time.
If 3rd party WS reports that remote data were changed - retrieve the new data and store it locally.
When user call your (local) web service - just retrieve that data from local storage (previously retrieved by Windows service) and pass that data back to client.
Best regards,
-----------
Igor Sukhovhttp://sukhov.net
-- modified at 1:17 Monday 29th May, 2006
|
|
|
|
|
I have a dll that I created in C# using .NET 1.1 and am calling this dll from a win32 app (to make a long story short, we need to use this approach as one of the components we have used and invested heavily in is no longer supporting win32 development. We have been advised to make a .NET dll and call it from the win32 app via COM).
When I load the dll on a machine with .NET 2.0 intalled, the dll throws errors when trying to access functions from the third party component. Apparently, the dll is loading the .NET 2.0 assemblies. On a machine with only .NET 1.1, the dll functions correctly.
How do I force the dll to load the .NET 1.1 assemblies? I am using C# Builder 2006 to generate the C# dll.
Mark
|
|
|
|
|
By using a app configuration file, i.e. an xml file in the same directory as the executable with the same name as the executable but with a .config appended to it.
E.g. if your app is in C:\app.exe then put this:
<?xml version ="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v1.1.4322" />
<requiredRuntime version="v1.1.4322" />
</startup>
</configuration>
in a file called C:\app.exe.config
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
I have created a Form that has a PictureBox in it used for displaying multiple images. The constructor for the Form receives an array of filenames. The Form will then display the first image, Sleep() for a user-specified interval, then show the second image, Sleep(), etc.
This all works find and dandy in the normal case. However, if I am dragging another window and it overlaps the Form while trying to change the image, I get an InvalidOperationException telling me that "the object is in use elsewhere", but it won't tell me which object, and then the area where the picture is supposed to be turns into a big red X.
The entire class is about 550 lines so I won't post it here, but here are some relevant code snippets:
[Everything looks OK in the preview but it looks like it eats my whitespace in the <pre> tags when it actually gets posted]
System::Void initialize_thread()
{
using System::Threading::Thread;
using System::Threading::ThreadStart;
draw_images_thread = new Thread(new ThreadStart(this, &PlotDisplayWindow::draw_images));
draw_images_thread->IsBackground = true;
}
System::Void draw_image(int image_num) {
picturebox->Image = __try_cast<System::Drawing::Image*>(images_[image_num]);
Text = filenames_[image_num];
graphics = this->CreateGraphics();
graphics->DrawImage(images_[image_num],
AutoScrollPosition.X, AutoScrollPosition.Y,
images_[image_num]->Width, images_[image_num]->Height);
graphics->Dispose();
}
__delegate System::Void DrawImageDelegate(int image_num);
System::Void draw_images()
{
using System::Threading::Thread;
while (running) {
if (picturebox->InvokeRequired) {
DrawImageDelegate* draw_image_delegate = new DrawImageDelegate(this, &PlotDisplayWindow::draw_image);
draw_image_delegate->Invoke(image_number);
}
else {
draw_image(image_number);
}
Thread::Sleep(sleep_time_ms);
++image_number;
if (image_number == filenames_->Length) {
image_number = 0;
}
}
}
System::Void PlotDisplayWindow_Paint(System::Object* , System::Windows::Forms::PaintEventArgs* e)
{
using System::Threading::ThreadState;
if (filenames_->Length > 1) {
if (draw_images_thread->ThreadState & ThreadState::Suspended) {
draw_images_thread->Resume();
}
else if (draw_images_thread->ThreadState & (ThreadState::Unstarted | ThreadState::Stopped)) {
initialize_thread();
draw_images_thread->Start();
}
}
else {
draw_image(0);
}
}
Here is the text of the exception box that comes up:
************** Exception Text **************
System.InvalidOperationException: The object is currently in use elsewhere.
at System.Drawing.Image.get_Width()
at System.Drawing.Image.get_Size()
at System.Windows.Forms.PictureBox.get_ImageRectangle()
at System.Windows.Forms.PictureBox.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:----------------------------------------
driver
Assembly Version: 0.0.0.0
Win32 Version:
CodeBase: file:----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.2032
CodeBase: file:----------------------------------------
Can anybody give any advice? I can email a sample project to somebody if they want a closer look.
--
Marcus Kwok
-- modified at 16:07 Wednesday 24th May, 2006
|
|
|
|
|
Hi,
to be honest I didn't even try to understand the whole code but I most probably know the problem:
Don't mix threading and painting! Dragging another window over your form will trigger dozens of paint events and generally its not safe to access the GUI from a different thread that it was created in.
In your case a simple Timer should be all you need.
|
|
|
|
|
Thanks.
Dragging another window over your form will trigger dozens of paint events Yeah, that's pretty much what I thought was happening but I couldn't see a way to make it safe.
I originally tried using a Timer but I couldn't get it to work right so I switched to the Threaded approach. However, this seems to add too much complexity. I will look at Timers again.
I assume I should use System::Windows::Forms::Timer instead of System::Threading::Timer or System::Timers::Timer, but I am still a little unclear on the differences among the three.
--
Marcus Kwok
|
|
|
|
|
Well, I did find an article[^] discussing the differences in the timers.
Time to start reading...
--
Marcus Kwok
|
|
|
|
|
Use the windows forms Timer. Basically I would just set some member variable to the image you want to show and then call Invalidate on your form/control in the Tick eventhandler.
In the paint function you could then draw the image according to the field.
|
|
|
|
|
Robert,
Thank you for your advice. I was able to get the System::Windows::Forms::Timer to work, and it works well, and is much cleaner than my threaded solution.
I am now getting some flickering and a little bit of weirdness when painting, but these problems are orthogonal to my original issue so I will do my research and start a new thread (no pun intended) once I figure out some stuff.
Thanks.
--
Marcus Kwok
|
|
|
|
|
Look for double buffering and SetStyle from the Control class .
|
|
|
|