Jump to content
  • Advertisement

xsirxx

Member
  • Content Count

    575
  • Joined

  • Last visited

Community Reputation

170 Neutral

About xsirxx

  • Rank
    Advanced Member
  1. blah I am half asleep, I found the answer. Although its not using a typedef which would have been nice to have, I can use this: TypeName="Mynamespace.DAL.DatabaseInterface`1[Mynamespace.DAL.FooBarTable]"
  2. Well I came to another stumbling block after redesigning my database code. I have a aspx page loading an asp:ObjectDataSource, problem is I have a static class called DatabaseInterface<T>. Which uses a generic that I want in the form of my class to access the database. We will call this DatabaseInterface<FooBarTable>. When I enter the TypeName in the aspx page under the ObjectDataSource creation it compiles fine. But then when running it says the TypeName can not be found. So I went ahead and did a, "using FooBarInterface = DatabaseInterface<FooBarTable>;" and yet if I place FooBarInterface into the TypeName it says the same thing... Also note that if I recreate the DatabaseInterface<T> as the FooBar static class it works just fine. So this has to do with using generics or it not recognizing the "using" keyword at runtime... Any ideas or help would be GREATLY appreciated! Thanks, Brad
  3. I wasnt saying it should, I was just saying that I thought there would have been a way. I think the web is really growing beyond what it was initially built for. Also I noticed on wikipedia that HTTP5 supports Comet, or Comet like bi-directional talking. Thanks for your help! --Brad
  4. Thank you for the replys guys! kylotan: Yea I realize that, but some types of applications would be better off if it had bi-directional. For instance a chat application. If a chat application had to constantly ask the server every couple seconds for a response, it would be a huge waste of bandwidth. I just assumed that there would be a way to do this given the strength of the web now.... rpgmaker: Those methods are really just one time events basically still called by the client right? Or can those events be fired off by the server when it wants? If so if you would be so kind as to throw a link my way? Right now I dont really have any post backs running except the first or of course on a refresh. I am using all call-backs which leads to almost 0 visible notices of a refresh. Then I have the client calling the server through a timer-callback and then I shoot back an array of JSON objects which are really my events to update the client.... But if I can take that timer out and somehow fire off a HttpResponse without a request, well that would be awesome! Thanks!
  5. First post here in a while, and Im just moving into playing around with web programming, so thanks for listening! Now here is my problem :) : Im currently programming in ASP.NET 2.0 with AJAX(JScript client-side) and C#(server-side). I currently have the client able from jscript to call up a server-side function and serialize/deserialize the string using JSON and custom converters. My problem now comes in where I want the server to call the client side by sending a string(or any object) without the client initiating the conversation. I know I can have a timer on the client side go off and then do a callback to the server-side function, but I dont want a timer always going off. So right now I have created a custom control extending System.Web.UI.WebControls.CompositeControl, IScriptControl, and ICallbackEventHandler. I have a registered client script block using Page.ClientScript.RegisterClientScriptBlock(...) that was help built using Page.ClientScript.GetCallbackEventReference(...) - which all works great. So final question is, how do I call up a client-side function from the server-side without using a timer on client to initiate conversation? Thanks much and if anyone has any information or another forum recommendation to post on I would GREATLY appreciate it! -Brad
  6. xsirxx

    more C++ hullabaloo

    Quote:Original post by musasabi thanks all. i understand how all three keywords work, im just asking about inheritance theory. i know protected is shunned by some (with good reason, in a lot of circumstances), but _without_ it, i dont really see how a class can inherit anything useful at all. like i was saying. item->weapon or item->armor for example. all items have a name and weight... but only weapons have damage, and armor has defensive properties. however, without declaring name and weight as protected, how can you have them inherited? AHHAHAH "protected" is shunned? Id love to hear a discussion where people can say its bad to use it. Can I ask where you heard this? I hope not from a book. and you can keep them public if you really dont want to use protected. But protected was created just for that reason, so use it! heh. EDIT: BTW after reading my post, it came off a bit mean to me, that was not my intention. I just cant seem to think of a reason to not use protected where it is needed. Also I meant public will let you do the same thing as protected but everything can see it. --Brad
  7. xsirxx

    more C++ hullabaloo

    Quote:Original post by Stormtrooper Private means nothing outside the class can access it, but an inheritor can access it. Did you mean Protected? To my knowledge I have never been able to access a private member in an inherited class... maybe a typo?
  8. xsirxx

    more C++ hullabaloo

    Sometimes there are objects that you dont want shared through what inherits it. For instance all guns will shoot bullets. So the bullet object doesnt have to be seen, just have its damage set. Sometimes there are objects that cant be seen because if they are changed in an inherited class they can screw up some other dependencies. Thats why the Protected keyword comes in. Inherited classes can then use the Protected keyword so nothing can access the member outside of the class, yet inherited classes can still see it. Lastly there is the Public keyword with allows for everything outside the class and inherited classes to see/use the member. Was that your question? --Brad
  9. xsirxx

    Check for three conditions

    int main() { int n, r, label1 = -1; srand( time(NULL) ); cout << "I have a number between 1 and 50." << endl; cout << "Can you guess it?" << endl; cin >> n; r = rand_0toN1(50) + 1; if (n == r) { cout << "Nice! Spot on!" << endl; } else { if( n < r ) cout << "Too low, try again" << endl; else if( n > r ) cout << "Too high, try again" << endl; } return 0; } int rand_0toN1( int n ) { return rand() % n; } Dont forget when checking IF statements you have to do the if equal to comparison, which is "==" not "=" which is setting the integer. Also note that the else statement is used to be the, if everything didnt work in the if statement, then we will execute the else statement. ELSE IF is well if the first didnt work, then we will execute this if n is > than r. Also format yer code. It will be more readable that way not only to u but other coders. 4th why is that goto statement in there? I hate goto statements so dont bother with me much, but I cant seem to understand it. You will never make it out of the program.
  10. Well you have to realize that if you want the pointer, then access it like so: int *intpointer = null; int setint = 8; intpointer = &setint;//sets intpointer's pointer location to setints. if either of the 2 change, they will contain the same value. like so... setint = 7;//now both setint and intpointer's value will be 7. unless, intpointer = null; // now its not set to anything again. if you want to access what its pointing to then use: int newint = *intpointer;// this sets the newint to the value of the pointer by dereferencing it. So now newint's value is the same as intpointer, but their memory locations are different, so they can each be changed seperatly.
  11. If you are working with C or C++ I would look into getting a book on beginning C or C++. Sam's teach yourself C in 21 days is fine for beginners and is easily explained. There will be a TON of other ppl who like other books so take with it what u will. I only say this because pointers are a HUGE part of C and C++. I also beg to ask, why C and not C++? Are u doing programming for ICs? or software? I suck at searching, I dont posses the google strength. But anywho here is a link not sure how good it is... http://home.netcom.com/~tjensen/ptr/pointers.htm EDIT: Gamedev link http://www.gamedev.net/reference/articles/article1697.asp
  12. Quote:Original post by kanato Then when you need to make type specific calls use reflection to inspect the generic arguments of the the members of the list. Heh i was just updating my post as you posted, that was QUICK! anywho, thanks much for the reply, any good places to lookup reflection like this under C#? If not no worries, ill dive deeper into it... Thanks again
  13. Ok hopefully sum1 can help me out here, I cant seem to find a way to do this in C#, if possible... I have a some generic class that I need generic, IE: public class Foo<_T>; Now I need to put a bunch of those in a list without knowing what _T is... for instance: List<Foo> newlist = new List<Foo>(); Now you cant do that because it needs a generic... SO: List<Foo<...>> newlist = new List<Foo<...>>(); What do I put in the "..." considering I dont know what might be added there? I have a list of a bunch of different types but thats going to get crazy... Ohh also I need to be able to use functions in each Foo without knowing what the generic is... Any ideas would help me out alot! Thanks much, Brad EDIT: btw I did find that if u create a base class with no generic it will work correctly, but you cant explicitly cast the child class that has a generic. So all functions must be included as virtual or abstract in the base class...
  14. Quote:Original post by Menno I'm sure C# has some easy to use standard XML serializer. Yea its ISerializable using SOAP.
  15. Quote:Original post by Mathius21 Thanks for the replies. I also read somewhere that you shouldnt have a problem loading a binary file in unmanaged c++ that was written in managed code. Well I think the problem is, how that binary file is written. What order? It would be interesting to know what order ISerializable is written as...
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!