|
iam so confised now,coz i can not run my application yet
and i do not know what is the problem exactly.
|
|
|
|
|
Well, it looks like your code was copied from the documentation. So I don't see much difference between that and MSDN. Are you using a WordProject?
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
i do not know what is word project exactly
but if it is wizard in vs.net,then i do not use it and it doesn't there
iam using vs.net2003 profissional
thanx
|
|
|
|
|
I'm using VS2003 and Office 2003 (So it might be an office thing) Anyway - I've emailed you the skeleton of the WordProject - it might provide clues to help with your problem. (Its easy for me because it does all the hard work getting everything integrated - You may have to change the project properties because the startup command line may be different in your case)
--Colin Mackay--
"In the confrontation between the stream and the rock, the stream always wins - not through strength but perseverance." (H. Jackson Brown)
Enumerators in .NET: See how to customise foreach loops with C#
|
|
|
|
|
thank u so so so much
and sorry coz i have to go know and c u after little hours
|
|
|
|
|
the erorr message say:
the server threw an exception
and nothing more.
|
|
|
|
|
Hi,
Does anyone know if the .NET framework has any support for easily creating property inspector style windows? Had a quick look through the available Windows Forms controls and components, but couldn't see anything of interest. Anyone any suggestions?
Cheers
Richard
|
|
|
|
|
You mean like the PropertyGrid ? This (or at least a similar control) is what VS.NET uses and it makes full use of the classes in System.ComponentModel so you can make properties with TypeConverter s and editors, as well as control the categories, descriptions, visibility, and other attributes using the attributes in System.ComponentModel . If you don't see the PropertyGrid in your toolbox, right-click on the toolbox and select "Customize toolbox". You'll find the PropertyGrid in there (it's in the System.Windows.Forms namespace).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Does anyone know how to make a exe that plays a video file in full screen?
|
|
|
|
|
You should take a look at Managed DirectX 9 (http://msdn.microsoft.com/directx[^]). The managed classes are written from the ground up and are much easier to use (still not a trivial thing to work with, though, so read the documentation!) and offer many features like that.
Otherwise, you'd have to create an interop assembly for something like the Windows Media Player, which should have a method to make it display full-screen (hint, download the small Windows Media Player SDK and see the documentation for player.fullScreen boolean property. This might also be in the MSDN Online Library).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi CodeProject member,
I got the fallowing code:
...
protected delegate bool ValidatorHanlder(object obj, ref string PropertieName, ref string ErrorNumber, ref string ErrorMessage);
PropertiesList = new Hashtable();
PropertiesList(StringProperty, new ValidatorHanlder(ZipCodeValidator));
public string StringProperty
{
get
{
return mStringProperty;
}
set
{
mStringProperty = value;
}
}
...
It is possible to reference the string by storing is pointer and not is value when added to the hashtable ? and if ZipCodeValidator is declare as static do i need to do a new pointer allocation on it?
(define Email (lambda ()
elacroix@devmesh.com))
Im not a church numeral im a free variable
|
|
|
|
|
System.String is a reference type already. If you try to modify the string, however, you will get the modified copy because strings are immutable. If you are trying to do this, use the System.Text.StringBuilder instead.
ZipCodeValidator is just a method. A delegate is like a managed function pointer. It doesn't care if the method is static or instance-based. You still need to use the new operator on the delegate, though.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I am attempting to develop an algorithm that will compare data in mutiple tables(e.g. Professors, Available Classes, Curriculum, Past Schedule) and create a new table that will be a become a class schedule for a department at a college. How can I create a new table in C#, without manipulating the database with MS Access itself.
|
|
|
|
|
First of all, C# is only a language that targets the CLR. It compiles to IL just like any other .NET language.
That being said, you can't do this in the .NET base class library (BCL). You can use ADO.NET to invoke SQL commands on many different data sources, but there is nothing to help you create tables, views, etc.
Depending on what database you are using, you can create COM interop assemblies to manipulate the database. You can interop DDL for Access and SQL DMO for SQL Server. I'm sure other major RDBMS's have similar libraries - at least those built with Windows technologies in mind.
This has been covered quite a bit in the last couple days so please search the comments (click Search Comments above) for this forum.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I'm trying to pass variables from my main.aspx page to the web user control page. I have a flash application that reads the variables and based on that displays a certain item that's embedded in the web user control page. The variable that I created needs to be on the main.aspx page, so when flash opens up it can tell which page it's on. It looks something like this:
This is on the control.ascx page, the problem with this is that it has to be on the same aspx page.
<param name="FlashVars" value="navStatus=<%=pageStatus()%>" />
This is on the main.aspx.cs page
public string pageStatus()
{
return "home";
}
I have also accomplished my goal by using session variables, but I don't want to use them. Is there is any way to inheret the function that's on the main.aspx or pass somekind of global variable to where it can be accessed anywhere. Remember that the variable needs to be in the main.aspx page, it can't be in a class library or component.
Thanks,
Jaime C
|
|
|
|
|
Do a Type-check and cast it. From the UserControl:
private void Page_Load(object sender, EventArgs e)
{
string value = null;
if (Page is main)
value = ((main)Page).pageStatus();
}
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hey Heath,
The function that I created on the main.aspx.cs page can be accessed from user.ascx.cs page, I don't have any problem with that. In traditional .asp pages I could just create a variable called pageStatus = "main" on the main.asp page and the user.ascs page would be an include file which would hold my flash application that have status = <%pageStatus%>, so if I went to home.asp page, the home.asp page would have pageStatus="home" and the services.asp page would have pageStatus="services". So in my flash application anytime you would go a page it would display the value of that page accordingly. Sorry, if I sound frustrated, doing some of the simpliest things in asp is a little more difficult in asp.net. I wrote this function out of frustration, I know there is a simpler way to do it. Thanks a lot in advance!
public string pageStatus()
{
string strURL = Request.ServerVariables["URL"];
StringBuilder replaceFunc = new StringBuilder(strURL);
strURL = replaceFunc.Replace("/web_isotope/","").ToString();
strURL = replaceFunc.Replace(".aspx","").ToString();
return strURL;
}
Also can I inheret the class from my main.aspx.cs page in the user.ascs.cs page.
Thanks again.
Jaime
|
|
|
|
|
How does one paint on a tree view? It turns out that if I make a user control based on treeview, events such as OnFocus, etc, do occur, but OnPaint and such don't ever occur.
I've done plenty of graphics / graph drawing using MFC and GDI++, so the problem is simply, how do I get the OnPaint event to occur? forcing a redraw doesn't seem to trigger it. It doesn't even get called the first time the control becomes visible.
|
|
|
|
|
The TreeView 's OnPaint handler is overridden so that it is not called (this is actually done in WndProc ). As I mentioned earlier (perhaps not to you, but I do say this all the time), most of the classes in System.Windows.Forms are just wrappers for common controls. Painting is only performed / allowed for controls that need to do custom painting in .NET. Otherwise, pretty much all properties you change an all methods you call actually set styles, send or post messages, and call native functions on an HWND that represents the common control.
This goes for the TreeView - no painting is required because the underlying control is already doing everything.
Instead - and I've done this on many occassions with success - override WndProc in your derivitive tree class and for Message.Msg 15 (WM_PAINT ) call the OnPaint method. You should also call SetStyle with the appropriate ControlStyles in your constructor to make sure that painting is handled correctly. In your WndProc override, be sure to call base.WndProc to allow the default implementation to handle everything you don't (which is quite a bit when you consider the whole class hierarchy).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thank you very much, this explains a lot.
It sounds like it may be better to just stick with MFC for now... I thought maybe .NET Forms (With C#) would be some step up from old fragile-feeling MFC, but now they are looking more and more like a somewhat inconsistent wrapper around the old MFC code, which is more powerful anyway... so its more like a step down, in many ways.
|
|
|
|
|
Yeah, well, WinForms is the least advanced part of .NET. They're planning to add some stuff in .NET 2.0, and then .NET 3.0 will use Avalon. But right now it's not all that powerful (although it really isn't that bad either).
|
|
|
|
|
No, both MFC and Windows Forms are wrappers around common controls. All MFC is just a wrapper for native methods anyway.
You'd have to do the same thing in MFC with messages. The only major difference is that MFC can include the appropriate header files and use the structures, messages, and notifications, as well as any other native functions. With Windows Forms, you have to create the necessary structures, define the messages and notifications as either consts or enums, and P/Invoke the necessary native functions (like SendMessage is a common one you need to P/Invoke). Besides that, it's really no different. You still handle certain notification messages and use SendMessage to send messages with the appropriate arguments to the appropriate handle (which you can get from controls through Controls.Handle ).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi, I recently installed the october edition of MSDN Library and I tried to look up something like IMediaDet in it and it had almost no available information. This is weird because I thought I remember in an older one that it had all sorts of DirectX 9.0 information and Managed DirectX information too, it seems like every newer version I install has less and less info, why is that?
|
|
|
|
|
For one, DirectX code is still changing and that means documentation will change with it. Also, the Summer 2003 updated some DirectX-specific documentation that may not have made it to the most recent MSDN Library (October 2003). If you really think this is a problem, this forum isn't the right place. Go to MSDN Online and email them (click the Contact Us link at the bottom).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
i downloaded this code and it's in c++. it's suppose to read the cpu temperature and display the result but i can't get it to run. can someone please massage it and make it run in c# becuase i don't know c++ that well.
thanks,
Rob Tomson
<br />
#include <iostream.h><br />
#include <windows.h><br />
#include <conio.h><br />
#define INDEX 0x295<br />
#define DATA 0x296<br />
<br />
#define BANK_SET 0x4e // lowest three bitti set a bank, in manual lk97 and lk109<br />
#define CPU_TEMP 0x50 // BANK 0 0x4e = xxxxx001<br />
#define MBM_TEMP 0x67 // 0x4e = xxxxx000<br />
<br />
int inline openIO(){<br />
HANDLE h;<br />
h = CreateFile("\\\\.\\giveio", GENERIC_READ, 0, NULL,<br />
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);<br />
if(h == INVALID_HANDLE_VALUE) {<br />
cout << "Couldn't access giveio device\n";<br />
return 1;<br />
}<br />
CloseHandle(h);<br />
return 0;<br />
}<br />
<br />
int main(){<br />
<br />
if(openIO()) return -1;<br />
<br />
_outp(INDEX, BANK_SET);<br />
_outp(DATA, _inp(DATA)|0x01);<br />
<br />
_outp(INDEX, CPU_TEMP);<br />
cout << "CPU temp: " << _inp(DATA) << "C\n";<br />
_outp(INDEX, BANK_SET);<br />
_outp(DATA, _inp(DATA)&0xf8);<br />
_outp(INDEX, MBM_TEMP);<br />
cout << "MBM temp: " << _inp(DATA) << "C\n";<br />
<br />
return 0;<br />
}
--
There are 10 kinds of people. Those who understand binary and those who don't.
|
|
|
|