|
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.
|
|
|
|
|
Unfortunatly i can't do that, as i didn't implement it, the control is supplied by the manufacturer of a camera.
The only documantation i have about it is the following:
GetBMP Method:
Description:
Returns the data and size of the current bitmap image.
Syntax:
CamImage.GetBMP Image, Size
Part Description
Image: Required. A variant containing the bitmap data.
Size: Required. Contains the size of the returned bitmap data.
Remarks:
Returns the data and size of the current bitmap image. The Display property has to be set to True when using the GetBMP method, otherwise the Jpeg images won’t be decompressed to bitmaps.
Example:
In this example a bitmap is captured with the GetBMP method and saved to a file.
Dim b As Variant
Dim Size As Variant
Dim a() As Byte
Call CamImage1.GetBMP(b, Size)
a() = b
Open "C:/Test.bmp" For Binary Access Write As #1
Put #1, , a()
Close #1
I hope this is helpfull!
I appreciate your help.
Venlig hilsen / Regards
Steffen Otto Jensen
(Denmark)
|
|
|
|
|
This is what you do
object bmp = new System.Object();
object size = new System.Object();
ax.GetBMP(ref bmp, ref size);
System.IO.MemoryStream ms = new System.IO.MemoryStream((byte[])bmp);
System.Drawing.Bitmap image = new System.Drawing.Bitmap(ms);
|
|
|
|
|
Thanks Rama Krishna
The code you gave me was Paste'n'Run.
That helped me a lot!
Venlig hilsen / Regards
Steffen Otto Jensen
(Denmark)
|
|
|
|
|
For those of you who've not seen it, I've uploaded part 1 of a chapter excerpt from my Inside C# book. This particular part is based on a topic I see frequently asked about - string handling in C# - and I believe covers many areas and issues not found in the online documentation and other texts.
Enjoy and please feel free to drop me a line regarding the article/chapter and even how it can be improved!
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
|
|
|
|
|
Thats good!
And helpful! Thank you man!
Rickard Andersson@Suza Computing
ICQ#: 50302279 (Add me!)
E-mail: nikado@pc.nu
I'm from the winter country SWEDEN!
|
|
|
|
|
When is Visual C++ .NET Bible available?
|
|
|
|
|
Thanks for the interest, Albert!
That book is being "processed" now. In other words, I'm done with my work and the publisher is printing it. That usually takes about 2 months to get to the store.
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
|
|
|
|
|
Cool!
So, should I buy it? Duh! I am asking the Author
Anything different from Step by Step Visual C++ .NET? How long it took you to write the book?
|
|
|
|
|
Albert Pascual wrote:
So, should I buy it? Duh! I am asking the Author
Actually, I'm very forthcoming and will tell you exactly whether or not you should buy the book based on your needs. Remember, it doesn't do me any good to sell someone a book that they don't like, will probably return and certainly not have nice things to say about.
Having said that, it doesn't look like the book is for you as the book you're comparing it to is a managed extensions book and mine is an MFC book.
Therefore, if you're looking for a beginner-level managed extensions book, I'd recommend the Step by Step. I don't know of any decent intermediate-to-advanced managed extensions books. On the other hand, if you're looking for a really good MFC book, then I would recommend mine without hesitation.
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
|
|
|
|
|
Thanks Tom,
Actually I am moving away from any MFC. I only use MC++ extensions and C# for UI (I use Inside C# as a reference)
Even that I think I am going to buy your book when it comes out, if is just as good as your Inside C# I am going to enjoy reading it!
Thanks
Al
|
|
|
|