|
yes,that's a great sample.
but to your experience,are there any resources that's introducing the design of websites from the beginning?
thanks!
|
|
|
|
|
I haven't heard much about .NET Windows Forms applications that run inside of a web browser like ActiveX controls or Java Applets. Does anyone have any pointers to books or web sites that cover this in depth? Basically I want to replace our existing application (HTML + ActiveX controls) with C# Windows Forms. I assume there is some way of packaging assemblies in CAB files but I just haven't heard much about this. Thanks!
Chris Hafey
|
|
|
|
|
I am trying to do something similar. I was told by someone at MS that remoting might be a good way to go about it. SOAPSUDS seams to not like forms, so that is out of the question. Unfortunately, you have to send the user an exe and possibly a DLL and make sure that he has the .NET framework. If you can find a better way of doing this, I'm open to suggestions.
|
|
|
|
|
Check out http://www.gotdotnet.com/compare/windowsforms/iesourcing.aspx
|
|
|
|
|
try
{
AccountTable = AccountDb.Tables["Accounts"];
if (AccountTable == null)
throw (new NullReferenceException());
}
catch (NullReferenceException)
{
// Table not present, create empty DB
AccountDb.Clear();
CreateEmptyDataBase();
}
Take a look at that if check. It passes even if AccountTable is NOT null. I checked with the debugger, it's NEVER null, but the if check always passes. The if check behaves fully correctly if I remove the try/catch statement.
That sounds broken to me, I have a hard time imagining this "feature" is by design Any ideas ?
greetings,
Tim
|
|
|
|
|
Hmmm...
Looks like that WebService debugging is VERY unreliable. Actually the code is executed correctly, just the debugger displays crap.
if I write
if (obj == null)
{
SomeStatement()
throw SomeException
}
it falsely executes the if, skips SomeStatement, executes SomeExcpetion, but doesn't actually throw it. That's f***ed if you ask me
Rebuilding app / restarting IIS doesn't help. There are also countless other cases were wierd stuff happens. Normal C# debugging works perfect
Sigh, looks like we have many many service packs ahead of us until this works...
greetings,
Tim
|
|
|
|
|
Everytime my C# web service throws and unhadled exception the response is just terminated and the browser sees an empty web site. I would like the debugger to catch the exception just like in an normal app. Please note that debugging is working, breakpoints etc., just not catching of unhandled exceptions.
As you can imagine, this default behavior of VS.NET is *extemely* annoying and I just see no justification for it.
Also, I was wondering, shouldn't the .NET / SOAP runtime at least generate an error response to let the client know that an exception was thrown on the server ? I have sometimes seen a nice exception page, but it rarely appears. Having the debugger catch the exception or showing this page all the time would be great, how to archieve that ?
Thanks for your time,
Tim
|
|
|
|
|
Hi,
I would like to know whether we can connect to CORBA (IONA) or Mainframe DB2 from C# .net platform. We currently have a COM dll written in VC++ which connects to CORBA to call corba idl functions which uses roguewave library. And also the component talks to mainframe through DB2.
I have gone through the .net documentation, but could not find any article saying how to connect to CORBA from C# or DB2. Also, is it possible to use VC++ static libraries (.lib) in c#.
Thanks
- Suresh
|
|
|
|
|
Can somebody help me.
I have the following line of code:
this.Text = String.Format( "Program {0:#}.{1:#}", ver.Major, ver.Minor );
Okay, what I don't understand is the use of ":#" in the substitution parameters. What's that good for?
And on a sidenote, why not just use regular string concatenation? Or is that because substitution parameters has some of the functionality of format specifier in C?
Thanks in advance
oh and remember: GO ANDE SEE __STAR WARS II__, it rocks, BIG TIME!!!
|
|
|
|
|
A very good article on what you are asking has just been posted by Tom Archer, here.
You can use string concatenation, but it is often easier to use String.Format since you can do various formating elements easily.
--
David Wengier
Sonork ID: 100.14177 - Ch00k
|
|
|
|
|
i download the screensaver project source codes in cp's "screensaver race",
when i open the sln,it has an item "web reference",
under the "web reference" lists a few files such as
"latest.wsdl,latest.disco,reference.map"!!
i want to know where do these files come from?
and what do these files do to the project?
i am a newbie in vs.net and web development.
so please give me some detailed explanations or give me some guide that i can find such resources.
thanks in advance!
|
|
|
|
|
Right click on your project in the Solution Explorer, choose Add Web Reference. Now in the top of the window that comes up type in http://www.codeproject.com/webservices/latest.asmx . Now press Enter so it loads the page then click "Add Reference".
Now you'll see a new entry under Web References titled codeproject.com.www , right click it choose rename, rename it to something more appropriate, such as codeProject . This name dictates what namespace the resulting classes will be placed into.
In the case of the CodeProject webservice the main class is LatestBrief, this class contains the methods needed to call the web service.
HTH,
James
Simplicity Rules!
|
|
|
|
|
thanks James!
but do you know where did the screensaver project use the LatestBrief class?
i see that the project linked with webresourceprovider.lib that is also in codeproject.com!
so what is the relation among "cp's webservices" and "webresourceprovider.lib" and the saver project itself!
anyone can give me some explain or hints!
thnaks in advance!
|
|
|
|
|
zhoujun wrote:
but do you know where did the screensaver project use the LatestBrief class?
Our (Christian Graus and I) screensaver uses the LatestBrief class in the UpdateList() method of the Saver class. That method's sole purpose is to update the data that the screen saver displays.
WebResourceProvider is used by Rama Krishna's screensaver to perform a technique known as scraping, where you download a webpage, then pick out the bits you want. You'll have to refer to his article to see how he uses it.
Both the CP Web Service and the WebResourceProvider are utilities to get information from CodeProject into the screensaver.
Hope that clears up some of your questions,
James
Simplicity Rules!
|
|
|
|
|
thanks,James,
your information is helpful for me!
|
|
|
|
|
How to run c# app on a win2000 machine without installing the framework? Is it possible? I heard something about compiling from the intermidiate language to the native using some kind of tools. How is this exactly done? Searched MSDN and could not find any info about this.
Thank you
vance
|
|
|
|
|
You'll need the runtime files:
http://download.microsoft.com/download/.netframesdk/Redist/1.0/W98NT42KMeXP/EN-US/dotnetredist.exe
Size: 19,7Mb
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
C# cannot be compiled to native code. To run C# applications you require the .NET Framework installed. Its a 20mb download from MS.
The only compiler in VS.NET to compile to native code is the C++ compiler. All the rest require the framework to run applications.
Michael
|
|
|
|
|
There is a tool to pre-JIT assemblies, but you still need to have all the framework stuff in order to even make use of that.
James
Simplicity Rules!
|
|
|
|
|
Hi' how are you.
I'm having some trouble with an ActiveX Control which i use in a project i'm working on.
The Control has a method like this:
Ax.GetCurrentImage(ref variant image, ref variant size)
Where the image parameter is supposed to return a bitmap.
And the size parameter returns the size of the bitmap.
I've tryed going in the direction of using a variable of the type System.Object, but that doesen't work.
If anyone has some ideas on how to attack this problem i would be grateful.
I'll try and post some more concrete code and error messages tomorrow when i get to work.
Venlig hilsen / Regards
Steffen Otto Jensen
(Denmark)
|
|
|
|
|
Did you not use AxImp tool or use IDE to add the ActiveX control. Variants are automatically converted to objects.
|
|
|
|
|
Hi' and thanks for your reply.
Yes i did import the control with the AxImp tool.
The code that is giving me trouble is the following:
object bmp = new System.Object();
object size = new System.Object();
ax.GetBMP(ref bmp, ref size);
** pictureBox1.Image = (Bitmap)bmp;
** The exception gets thrown on this line, and sounds like this:
an unhandled exception of type System.InvalidCastException occured in WindowsApplication2.exe
Additional information: Specified cast is not valid.
The "blueprint" for the method looks like this:
ax.GetBmp(ref object vimage, ref object vsize)
And in the documentation for the ActiveX Control the two parameters of the GetBMP method is listed af Variant types.
Holding that together with this table from the framework SDK i guess the variant type is not completely supported:
TypeCode COM variant type
----------------------------------------
TypeCode.Empty --> VT_EMPTY
TypeCode.Object --> VT_UNKNOWN
TypeCode.DBNull --> VT_NULL
TypeCode.Boolean --> VT_BOOL
TypeCode.Char --> VT_UI2
TypeCode.Sbyte --> VT_I1
TypeCode.Byte --> VT_UI1
TypeCode.Int16 --> VT_I2
TypeCode.UInt16 --> VT_UI2
TypeCode.Int32 --> VT_I4
TypeCode.UInt32 --> VT_UI4
TypeCode.Int64 --> VT_I8
TypeCode.UInt64 --> VT_UI8
TypeCode.Single --> VT_R4
TypeCode.Double --> VT_R8
TypeCode.Decimal --> VT_DECIMAL
TypeCode.DateTime --> VT_DATE
TypeCode.String --> VT_BSTR
Not supported. --> VT_INT
Not supported. --> VT_UINT
Not supported. --> VT_ARRAY
Not supported. --> VT_RECORD
Not supported. --> VT_CY
Not supported. --> VT_VARIANT
Or am i just confused..
I hope to get some input back
Venlig hilsen / Regards
Steffen Otto Jensen
(Denmark)
|
|
|
|
|
Try to create an actual bitmap object and see if it works, like this:
Bitmap bmp = new System.Drawing.Bitmap();
int size = 0;
ax.GetBMP(ref bmp, ref size);
pictureBox1.Image = (Bitmap)bmp;
Gaul C. Ihenacho
Gaulles Technologies, Inc
http://www.gaulles.com
|
|
|
|
|
Bad luck.
when i use your suggestion:
Bitmap bmp = new System.Drawing.Bitmap(352, 288);
int size = 0;
axImage1.GetBMP(ref bmp, ref size);
pictureBox1.Image = (Bitmap)bmp;
I get the folowing error messages:
* The best overloaded method match for 'AxATLCAMIMAGELib.AxCamImage.GetBMP(ref object, ref object)' has some invalid arguments
* Argument '1': cannot convert from 'ref System.Drawing.Bitmap' to 'ref object'
* Argument '2': cannot convert from 'ref int' to 'ref object'
But thanks for your help.
Im not sure what i should do now...
Venlig hilsen / Regards
Steffen Otto Jensen
(Denmark)
|
|
|
|
|
I see that this problem is not yet solved.
What are you returning the Variant as VT_DISPATCH? Can you post a bit of implementation of your COM method GetImage.
|
|
|
|