Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

170 Neutral

About Talib

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Just for interest sake. I tried calling the method in VB and it works with the following code: Dim CCTObject As Object CCTObject = CreateObject("CCTServer.Document") Dim Result = CCTObject.InitializeDevice("Camera") Dim ms As String Result = CCTObject.GetLastCCTError(ms)
  2. Hi I am fairly new to Interop/Com/ActiveX etc, so bear with me. I am late binding into a com/activex (not sure which one) server (basically an exe not a dll). I am successfully using all the methods in that server except for one, here is the description: Quote:VT_INT GetLastCCTError (variant *error_string); Description: This function is used to retrieve the last error generated by the CCT. The function may be called at any point as long as the CCT Server is initialized. If no error has occurred when the function is called, the returned code is ‘0’ (zero), and the error string will be empty. Only the last error that occurred during the current run of the CCT Server will be available. Input: None Output: The function returns a single output parameter, ‘error_string’ of type VARTYPE VT_BSTR | VT_BYREF. The parameter contains an error string for the error code associated with the last CCT function failure. Return Value: This function returns an integer value of type VT_INT. This is the error code associated with the last CCT function failure I first tried using this code: this.LastErrorCode = (int)CCTType.InvokeMember("GetLastCCTError", BindingFlags.InvokeMethod, null, CCTObject, new object[] {this.LastErrorString}); I got the following exception: Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH) Then after some thinking I changed the code to: object[] Args = { "SomeString" }; this.LastErrorCode = (int)CCTType.InvokeMember("GetLastCCTError", BindingFlags.InvokeMethod, null, CCTObject, Args); Still the same error. After some googling, I found this article: http://www.informit.com/articles/article.aspx?p=27219&seqNum=8 If you look at section 3.3 it seems to be the solution to my problem, and thus I changed my code to: object[] Args = { "SomeString" }; ParameterModifier ParMod = new ParameterModifier(1); ParMod[0] = true; ParameterModifier[] ArrParMod = { ParMod }; this.LastErrorCode = (int)CCTType.InvokeMember("GetLastCCTError", BindingFlags.InvokeMethod, null, CCTObject, Args, ArrParMod, null, null); this.LastErrorString = (string) Args[0]; This still results in the same exception. I am now thinking that the problem might not be the reference passing but something else. Any help will be appreciated. PS: Also posted this on stack overflow, but it seems to be disappearing into void there.
  3. Hi I want to find out for which version of .NET Framework my code gets compiled to. Id it the .NET version installed on the system or the version in VS Help->About? I'm leaning to the second, but just want to make sure. Thanks PS Tried googling this, but seemed to ask the wrong question, as "What version of .NET is my software compiled" or any alternative yields anything but what I want. And I can't seem to find the right keywords. PPS And for those wondering it is C#
  4. Hi I have a simple electronic circuit that I control via the parallel port. I wrote a CGI app (C++) to control this via a webpage and it works fine. My problem is that I would like to integrate a software based timer (switch the elctronic circuit on and off at certain times). The CGI app does not seem ideal for this task as it only runs when it is called via the web and an auto refresh page is not ideal for me. My thought was to write another system tray/background application that would basically do the timing and switching of the electronic circuit. Thus the CGI app would have to communicate with this background app. This is where I need the advice/an elegant solution. Here is some more details: Platform: Windows XP / Vista Webserver: IIS Code: C++ or C# My first thought was to write to a file and both the CGI and background app using that file to communicate, but I am not sure how the permissions will work here and it does not seem to be the ideal solution. Another route might be a windows service, but this is where I have no experience and do not wish to start learning how to do it, to only find that it won't work. Any suggestions would help. Thanks in advance.
  5. Hi I tried to pass a struct by reference between two windows (using the ref keyword as structs are normally passed by value). So I passed the struct in constructor of the new window. My problem is this: source lang="c#"] public MyClass { private MyStruct PaasedStruct public MyWindowConstructor(ref MyStruct _MyStruct) { //This copies the value or the passed struct. I would like to reference the original struct this.PassedStruct = _MyStruct; } } [/source] Excuse any syntax errors in the above, I just typed it quickly. Currently I am using a class instead of a struct as this does what I want it to do. I just want to know how would you approach this with a struct. Is this possible or is this bad practice?
  6. You could also let VS create a installation file for you, as the installation file will install all relevant dependencies. To do this (VS2005): Open your project File -> Add -> New Project Other Project Types -> Setup and Deployment -> Setup project (give it a different name than your current project) (You'll see the setup project added to your solution explorer) Now in the setup project add primary output from project to the application folder (by right-clicking), you'll see the dependancies list change in the solution explorer. (if not right-click on it and say refresh) Also add other relevant files and directories. Then Build the setup project Hope this helps.
  7. It's happening with posts (Edit: AJAX only) as well, I found the following blog that helped: http://matthom.com/archive/2006/07/08/more-ajax-post-over-get and http://matthom.com/archive/2006/07/08/javascript-function-to-the-rescue
  8. Sounds acceptable. I have a 100kb page design limit (excluding user content). I'll have a look into it.
  9. Looks interesting, I'm just worried about excessive code loading. South Africa is not famous for lightning fast internet. Thus I'm worried about my pages having to load the entire API. How does prototype affect page loads?
  10. It seems I have to use encodeURIcomponent() when passing my form elements to AJAX. Wonder why no tutorials mention this. [edit] Anybody that is experienced with AJAX, do you this with all your text fields or is there another solution or am I doing something wrong?
  11. Stupid me, did the same simple experiment and walla it worked. I forgot to mention that the textbox uses AJAX, so that seems to be where the problem is. Might it be that browser doesn't encode posted data that is sent with AJAX? BTW I am using Firefox [Edit] Nor magic quotes, learned my lesson with that long ago.
  12. Hi I've googled everywhere for an answer and couldn't find a definitive one. I have simple textbox which I then POST. However, when I type a plus sign into the textbox it is translated to a space. OK, so from what I've read, the plus sign is also used to represent a space in a URL. OK, good enough I understand. And also according to most people I should use urlencode() as used in the example provided by documents of urlencode(): <?php echo '<a href="mycgi?foo=', urlencode($userinput), '">'; ?>; But how do you apply this to a form? I've also read somewhere that the browser is suppose to encode the plus sign (I am not sure how correct this is). I can manually replace plus signs with javascript, but this doesn't seem like correct solution. My Setup: IIS PHP v5.2.5 It's basically just a test server [Edited by - Talib on March 5, 2008 1:06:59 AM]
  13. Talib

    good 2D engine

    I've been using Haaf's Game Engine. Very easy and well documented, you might try SDL as well.
  14. Talib

    A mobile phone where you can code

    I was looking for the same thing for my Nokia 9500, I couldn't find much. The closest thing I got was Python for S60 ( Link ), but the 9500 is a S80 model. I would recommend the new Nokia E90 which has S60 for this. If you do find anything else, please let me know. As I am also looking. As for those asking why we ppl would want to code ON (not FOR) our mobile devices ... because WE CAN. (see my profile for the previous discussions)
  15. Hi Nice to see some MTG ppl in this forum. If the comic strip is good you might wanna post it at the forums in www.magicthegathering.com. I'm sure they'd love to see it as well.
  • 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!