Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
C

Chua Wen Ching

@Chua Wen Ching
About
Posts
54
Topics
26
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Use Internet Explorer to send remote popups
    C Chua Wen Ching

    Hi, thanks for the reply. How to use sessionCookie on such scenario? Can you assist me further? The way I see sessionCookie is more like a lightweight repository storing data. How can it be used to send remote popups to all my users in the intranet with proxy enabled? Thanks.

    Regards, Chua Wen Ching Visit us at http://www.necoders.com

    ASP.NET csharp asp-net sysadmin json question

  • Use Internet Explorer to send remote popups
    C Chua Wen Ching

    Hi there, I will like to enquire some information on this. I have 2 scenarios: 1st: I had seen an existing web application program written by a developer in my company. But that the developer had left the company before I joined. Basically this web program has a gridview. Each connected to the system will have an IP address, based on the senior the program called some IE 5 or 6 API to get the IP address of each connected users and then send them a popup message. Just like netsend but instead through IE. Something like that? Any idea how I can accomlish this in IE 6 and 7? Probably somewhere I can get started with. 2nd: Basically this web program is functional until the new customers has a proxy server. WIth this proxy server enabled, whatever workable in 1st scenario no longer works here. Is there any alternative to overcome this? I am sure this is workable for the 1st scenario as I had seen it working. But I am not sure how that developer gets it to work. I had researched but I was not so sure what keywords to start with. Can anyone provide me some assistance here? I am using ASP.NET 2.0 for web development and my target browsers are IE6 and 7. Thanks. Regards, Chua Wen Ching

    ASP.NET csharp asp-net sysadmin json question

  • C# Obfuscations - need your input on my questionnaires please
    C Chua Wen Ching

    Dear all, I am not too sure whether I can post this here. I hope I am not advertising. I am working on a community project to share to the public on obfuscation. I had prepared a set of questionnaires and hope you can fill in. I know it is quite trouble some. http://nos.blogsome.com/2005/07/17/noos-questionnaires/ Thank you. Cheers. Regards, Chua Wen Ching Visit us at http://www.necoders.com

    C# csharp com

  • Convert Hex strings to Long/Decimals?
    C Chua Wen Ching

    I have a problem. But on .NET 1.1 My Scenario: Actually I will have a string of hexadecimals read from a xml file. Then from the hexadecimals, i will add 1 value whenever i made any modifications. But just i do not how to get started. It is like an incremental hexadecimals. I have a string of hex. string strHex = "0100000000FF"; I want to convert this Hex to decimals, just like the windows calculate, when you type FF in Hex and click on Dec radio button, it will change to 255. I tried string.Format("{0:d}", strHex); I tried Convert.ToDecimal or Convert.ToInt64 But i still cannot find a solution? ---- I know how to convert long to hex. Like this. for (long x = 000000000000; x <= 281474976710655; x++) { Console.WriteLine(string.Format("{0:x12}", x)); Console.ReadLine(); } But i do not know how to do the opposite? Anyone can help me please? Thanks. Regards, Chua Wen Ching Visit us at http://www.necoders.com

    C# help csharp com xml tutorial

  • Platform Invoke (pinvoke)
    C Chua Wen Ching

    Hi, You can do this. [DllImport("mcp.dll", EntryPoint="_ProcAuthorizationWeb@4", SetLastError=true)] internal static extern bool _ProcAuthorizationWeb(ref CreditCardStruct CreditCardStruct); Hope it helps. Cheers. Regards, Chua Wen Ching Visit us at http://www.necoders.com

    C# csharp c++ mcp data-structures help

  • Refreshing Panel
    C Chua Wen Ching

    Hi, Try this instead. private void panel1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { Refresh(); } Hope it helps. Cheers. Regards, Chua Wen Ching Visit us at http://www.necoders.com

    .NET (Core and Framework) help graphics tutorial

  • help me!!!
    C Chua Wen Ching

    Hi, You can look into p/invoke! Just assume that you have a C++ dll, and you want to call into your C# application. [DllImport("yourapp.dll")] internal static extern int SomeMethod(); Hope it helps. Cheers. Regards, Chua Wen Ching Visit us at http://www.necoders.com

    .NET (Core and Framework) c++ csharp help tutorial workspace

  • c# and using ports
    C Chua Wen Ching

    Hi, Look at the kernel32 writefile function. There are many examples out there on communicating with serial port. Hope it helps. Cheers. Regards, Chua Wen Ching Visit us at http://www.necoders.com

    C# csharp question

  • wrap a dll into another dll
    C Chua Wen Ching

    Maybe you can buy an enterprise version of obfuscation and then obfuscate your assembly. It might confuse the crackers when reverse engineering your assembly. And i don't think you achieve with what you want. Cheers. Regards, Chua Wen Ching Visit us at http://www.necoders.com

    C# csharp c++ question

  • Expriences
    C Chua Wen Ching

    Hi, You can learn c# 2.0 as it will be release any sooner probably this year. Learn the C# features - e.g generics. Learn how to use OOP + Design Patterns (Singleton) in C#. Learn .NET Coding Best Pratices when you coding C#. Well there is a tool called FxCop. It will help you to analyze your code. It is quite useful. Best to learn to walk before running. Hope it helps. Cheers. Regards, Chua Wen Ching Visit us at http://www.necoders.com

    C# csharp

  • NAnt - how to get this working?
    C Chua Wen Ching

    Hi Ian, You get me wrong! I just want to know how NAnt can be able to achieve that. I want to achieve this in my own custom xml script. 1234 5555 ${output} I want to achieve the same way like what NAnt can do. But i do not how know NAnt achieve that. I saw the source code, and there are so many class files. I am not looking for how to use NAnt with the property, just how to code the same way in my software. Any tips please? Thanks. Regards, Chua Wen Ching Visit us at http://www.necoders.com

    C# com tools xml tutorial question

  • NAnt - how to get this working?
    C Chua Wen Ching

    Hi there, I try to find on the internet on how to achieve this, but still can't find any good resources till i downloaded Nant. But there are too many codes inside Nant, and i have no idea which part of Nant code that can achieve this below. --> I want to get the value of project.name. So i can use the ${project.name} a few times in my xml script. Any idea on how to achieve this? Thanks. Regards, Chua Wen Ching Visit us at http://www.necoders.com

    C# com tools xml tutorial question

  • XmlDocument Write problems and Add Identation Help!
    C Chua Wen Ching

    Hi, Thanks Stanimir_Stoyanov and J4amieC. I got it right already with your suggestions. Cheers. Regards, Chua Wen Ching Visit us at http://www.necoders.com

    C# csharp com xml help question

  • XmlDocument Write problems and Add Identation Help!
    C Chua Wen Ching

    Hi there, I have 2 questions to ask. 1) I have this code... XmlDocument doc = new XmlDocument(); doc.Load(myXmlPath); int maxValue = 0; int newValue = 0; XmlNodeList nodeList = doc.SelectNodes("//Product"); foreach (XmlNode node in nodeList) maxValue = XmlConvert.ToInt32(node.Attributes["id"].Value); XmlElement newElem = doc.CreateElement("Product"); newValue = maxValue + 1; XmlAttribute newAttr = doc.CreateAttribute("id"); newAttr.Value = newValue.ToString(); newElem.Attributes.Append(newAttr); doc.DocumentElement.AppendChild(newElem); XmlElement elem = doc.CreateElement("Description"); elem.InnerText = "JVC Camera"; doc.DocumentElement.AppendChild(elem); XmlTextWriter wrtr = new XmlTextWriter(myXmlPath, Encoding.UTF8); doc.WriteTo(wrtr); wrtr.Close(); Xml (Before) // xml has identation nicely ---------------- Panasonic Camcorder Xml(After) // xml has no identation -------------- Panasonic Camcorder JVC Camera Xml (Expected this) ----------------------- Panosonic Camcorder JVC Camera Note: I want the Second Description tag to be part of Product id="2", but with my C# codes, i can't achieve it. 2) After i perform the C# code on top, my codes has no more identation. It seems that it removes all the whitespaces to this. (Please take note, the above xml examples, i manually re-arrange the generated xml for clear view). Xml (After) -------------- Panasonic CamcorderJVC Camera I hope i can indent nicely, just like what i did above on original xml file. Any help please? -- Regards, Chua Wen Ching Visit us at http://www.necoders.com Regards, Chua Wen Ching Visit us at http://www.necoders.com

    C# csharp com xml help question

  • C# XPath Problems
    C Chua Wen Ching

    Hi, I read from this tutorial at codeproject Question A: http://www.codeproject.com/csharp/GsXPathTutorial.asp regarding xpath.. but i try to apply in my situation, and can't get it work... just say this is my xml file: Device.xml ========= Titan123 Titan Suprema 13 BBB Hardware BBB DH 6 In my C# code, string devicePath = Application.StartupPath + @"\device.xml"; // open XmlTextReader ... int nMaxId = 0; // get maximum devices within XML script while(xmlDevice.Read()) { if (xmlDevice.IsStartElement() && xmlDevice.Name == "Device") { int nId = Int32.Parse(xmlDevice.GetAttribute("id")); if (nMaxId < nId) nMaxId = nId; } } } // Execute XPath here XPathDocument xdoc = new XPathDocument(devicePath); XPathNavigator nav = xdoc.CreateNavigator(); // loop into 2 possible devices and extract particular information for (int i = 1; i < nMaxId + 1; i++) { XPathNodeIterator nodeItor = nav.Select( "DeviceList/Device[@id='" + i + "']/Connection"); nodeItor.MoveNext(); TraverseChildren(nodeItor); } ... // from the article private void TraverseChildren(XPathNodeIterator nodeItor) { XPathNodeIterator igor = nodeItor.Clone(); igor.Current.MoveToFirstChild(); bool more = false; do { PrintNode(igor.Current); more = igor.Current.MoveToNext(); }while(more); } private void PrintNode(XPathNavigator nav) { MessageBox.Show("Value: " + nav.Value + " Type : " + nav.NodeType.ToString()); } From this solution: i get this instead: MessageBox1 - Value: Titan123 Titan Suprema 13BBB Hardware BBB DH 6 MessageBox2 - Value: Titan123 Titan Suprema 13BBB Hardware BBB DH 6 (repeat the same message - why?) Any help please? I want to get the Output of this: MessageBox1 - Value: Titan123 Titan Suprema 13 MessageBox2 - Value: BBB Hardware BBB H 6 Question B: By the way ho

    C# csharp xml question com hardware

  • C++ Def and Non-Def file - Function Signature - help!
    C Chua Wen Ching

    Hi there, I had a question. I just noticed the availability of module definition file *.def. I had a few doubts. The current scenario: ------------------------- *The wrapper dll's library and dll is place under the SDK folder. The lib file is included in the project under the visual studio path settings. SDK -> Wrapper Dll SDK code: ------------- #include "wrapper_dll.h" extern "C" __declspec(dllimport) double TestA(double a, double b); Wrapper DLL Code: ------------------------ #define extern "C __declspec(dllexport) EXTERN double WINAPI TestA(double a, double b); When you built in into a dll, when you view the dll dependecies, you will notice this (example): Ordinal = 1 (0x0001) Hint = 0 (0x0000) Function = _TestA@20 EntryPoint = 0x0000101E *The build dll, lib and header file is past to the SDK team to call it. ============================================================ Now, I want to implement def file: SDK (cannot modified, coz done by someone else and different team) but it still calls the Wrapper dll. SDK code (same with on top): ----------------------------------- #include "wrapper_dll.h" extern "C" __declspec(dllimport) double TestA(double a, double b); New Wrapper Dll code: --------------------------- wrapper_dll.cpp: double TestA(double a, double b) { return a + b / 10; } wrapper_dll.h: #pragma once // what does pragma means anyway?? any idea??? double TestA(double a, double b); wrapper_dll.def: LIBRARY Wrapper_Dll EXPORTS TestA Now, when i view this dll dependencies, it appears to be like this: Ordinal = 1 (0x0001) Hint = 0 (0x0000) Function = TestA EntryPoint = 0x000128A7 *problem is the Function name is changed, entrypoint number is change... will this cause problem for the SDK when calling. ============================================================ I need to make sure SDK should be recompiled. I just have to replace the new wrapper dll, lib and .h into the existing files that is part of the SDK folder. Should i be using def or not def? The current old code is using no def file. Means the sdk will have __declspec(dllimport) and the wrapper will have __declspec(dllexport), and the #include "Wrapper_dll.h" is still part of it of the sdk. Please help! Module definition file is indeed easier for us as a coder to code. But i just want to see what is the advantages of using def over the others. Thanks. Regards, Chua Wen Ching :p

    C / C++ / MFC question c++ help csharp visual-studio

  • C++ - A scenario - any recommendations please?
    C Chua Wen Ching

    Hi there, I had a very tough scenario, and seriously i had no idea how to solve this. It will be long as i tried to explain in detail. I need a good solution based on those who coded c++ and writes dlls. Before this: There is a dll called by UtilityA.dll. It was called by a UtilityMain SDK. In UtilityA.dll, it actually calls a 3rd party dll called 3rdPartyv1.dll. The main reason of UtilityA.dll existence is to write a wrapper and simplies stuff. So the UtilityMain SDK can call it easier. No idea why it is done like that. Now: We had released a new hardware. The new hardwares uses the new 3rdPartyv2.dll. There are 19 functions inside the 3rdPartyv2.dll if compare to 3rdPartyv1.dll which only contains 15 functions. But the names are roughly the same, but in some functions, there are additional paremeters and return different data types. I need to write a wrapper for the 3rdPartyv2.dll that will called the new UtilityB.dll instead of UtilityA.dll with additional new 4 functions (19 - 15). So my SDK can called my UtilityB.dll. The problems now: 1) We had many SDKs, around 20 versions. On different companies and countries. 2) If we use a different wrappers name, we had to recompile the SDK. Which is kind of tough! 3) If we stick the same called UtilityA.dll, but just say in future, the hardware already more advanced and a different modal. We can't just use UtilityA.dll again and again. Real example: Reader - Utility435.dll which calls the MXM435.dll which MXM435 is a reader device. Now there is a new model called MXM467 reader. If i use back the same Utility435.dll, which is misleading, does not represent anything. No choice the previous coders, never think of this problem. 4) There are many applications already being developed in VB6. We can't ask all the clients to recompile their apps because the SDK had been modified. Very very tough deployment. How can we solve this scenario? Now is between the wrapper and the SDK. Is there anyway to write a plugin to the SDK. As what i know from C#, you can write a library that exposes some interfaces, so you can write a plugin to it. But now the SDK had existed, and it was badly done i suppose. I not even sure it can have plugin enabled. I was hoping to write something, that can add on to the SDK on run time or dynamically without recompiling any existing codes, and won't affect any parties. But of course I had to change the new 3rdPartyv2.dll and the new wrapper. Just don't want to recompile the SDK. 3rdPartyv1.dll and 3rdPartyv2.dl

    C / C++ / MFC tutorial csharp c++ sysadmin

  • Pcoket PC OS: Easy to hack too?
    C Chua Wen Ching

    Hi there, I never really had a real pocket pc 2003 pocketpc. I had a couple of questions to ask. 1) Is pocket pc 2003 Operating System as easy to hack as Windows? Just assume hackers from the internet. 2) Just say, i had an .net program. Can i do something that only my pocket pc 2003 device or emulators can runs that application? All the other programs like games, windows explorer, msn messenger, etc are lock down. I want to let my pocket pc 2003 device or emulator to primary sychronize on the .net application. Is there any ways to do that? Something like a cyber cafe system but on a pocket pc. Thanks. Regards, Chua Wen Ching :p

    System Admin csharp question

  • How to create XML Editor with c#?
    C Chua Wen Ching

    Yeah, thanks for the link again. I want to develop for myself. Anything that is written with c# and work with .net framework 1.1? Just wonder, intellisense is something free to download and add into my system or what? Just assume i write a xml editor which i require intellisense. Any help? Thanks.

    C# tutorial csharp tools xml help

  • How to create XML Editor with c#?
    C Chua Wen Ching

    Hi there, Thanks for the url. I am looking to how to do that, not using any component. I just want to write a xml editor, so i can save up money and code xml much easier. Any help, on areas which i can achieve the thing i want, please? Thanks.

    C# tutorial csharp tools xml help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups