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
N

nmhuy

@nmhuy
About
Posts
20
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Access unallocated memory...
    N nmhuy

    You're right. I had a typing mistake. m_iLength is an integer. Thanks for you answer.

    Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    C / C++ / MFC question performance help

  • Access unallocated memory...
    N nmhuy

    Hi guys, I've got a problem as follow. Suppose we have a string class named MyString. This class has a constructor to construct a MyString object base on a char * like this: class MyString { private: char *m_pData; int *m_iLength; public: MyString(char *s) { m_iLength = strlen(s); m_pData = new char[m_iLength + 1]; strcpy(m_pData, s); } }; And we have a main function like this: void main() { char *p = new char[5]; MyString s(p); } The question is: the p pointer is allocated only 5 char in the memory, but the strlen function can return a value bigger than 5 (depend on where it finds the '\0' char in the memory of pointer). So the MyString object can access unallocated memory. Does it safe? How can we solve this problem? Best regards.

    Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    C / C++ / MFC question performance help

  • Get derived classes of a base class
    N nmhuy

    Yes, it's a trade-off. Thanks for sharing your opinion. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    C# csharp help question

  • Get derived classes of a base class
    N nmhuy

    I think client will prefer short and friendly name to long and hard to remember class name. I just study it from the Java Cryptography Framework. We can get an MD5 hash algorithm like this: MessageDigest md = MessageDigest.getInstance("MD5"); We do not need to know the name of the class that implements the MD5 hash algorithm. Hope to see your opinion. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    C# csharp help question

  • Get derived classes of a base class
    N nmhuy

    Hi, Here is the context that I use reflection: - The library has a base class, e.g AbstractAlgorithm, and some derived classes, e.g ConcreteAlgorithm1, ConcreteAlgorithm2, ... We can get an algorithm instance like this: AbstractAlgorithm algo = new ConcreateAlgorithm1(); - I want to provide another way for client to get an algorithm instance by its name like this: AbstractAlgorithm algo = AlgorithmFactory.createInstance("XYZ algorithm"); So I add an abstract method "getName()" to AbstractAlgorithm base class and each concreate algorithm class implements this method to return its name. The "createInstance(string)" method of AlgorithmFactory will use reflection to enumerate through the derived classes of AbstractAlgorithm, call their "getName()" methods to select the right algorithm class. After that, I use .NET class Activator to create an algorithm instance of the selected class. By doing this (instead of using "switch case" statement), the "createInstance(string)" method is unchanged when new concrete algorithm classes are added to the library. Is it a right design? Hope to see your opinion. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    C# csharp help question

  • Get derived classes of a base class
    N nmhuy

    I got it! Thank you for you helping! Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    C# csharp help question

  • Get derived classes of a base class
    N nmhuy

    Hi everybody, I am developing a library for my company and encounter a problem. In my code, I need to know and enumerate through all the derived classes of a base class. Are there any way to get the derived classes of a base class by using reflection in C#? Hope your replies, thanks. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    C# csharp help question

  • Retrieve & update data against remote database
    N nmhuy

    Thanks for you help! Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    Database help database sysadmin question announcement

  • Retrieve & update data against remote database
    N nmhuy

    I am developing an Access 2000 database application. In my application, I need to connect to a remote Access 2000 database to retrieve and update data. I tried to use RDS (Remote Data Service) as mentioned in MSDN but failed (it raised a runtime error 8447: Internet Server Error). Dim cn as ADODB.Connection Dim rs as ADODB.Recordset cn.Open "Provider=MS Remote; Remote Server=http://myServer; Data Source=sample.mdb" Set rs = cn.Execute(mySelect) Do I need any configurations on the server to make the above code work? Or are there any way else? Please help me, thanks. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    Database help database sysadmin question announcement

  • Save changes prompt
    N nmhuy

    Hi everbody, I am developing an ASP.NET application that has many pages. User can move from one to another page by clicking on the navigation bar on the left side of the screen. There is a page where users enter their information. While entering information, if they move to another page, I want the application to display a save changes prompt. Should I use the client side code (e.g JavaScript) or server side code (I see yahoo mail open a new window acts as a prompt)? What is the best way to due with this problem? I have few experiences in developing web-form application. Please advise, thanks. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi -- modified at 4:16 Sunday 11th September, 2005

    ASP.NET question csharp javascript asp-net sysadmin

  • Change source control
    N nmhuy

    Thanks for your helping! Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    IT & Infrastructure csharp visual-studio question

  • Change source control
    N nmhuy

    Thanks for your helping! Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    IT & Infrastructure csharp visual-studio question

  • Working on POST method with BHO?
    N nmhuy

    Send data to an URL by POST method. I want the BHO send data automatically to an URL by POST method. In case of GET method, the BHO can easily send data to an URL by using the Navigate method of the IWebBrowser (e.g MyWebBrowser.Navigate2("http://...?data1=abc&data2=xyz"). But how can we send data an URL in case of POST method?Thanks. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    C / C++ / MFC help question

  • Working on POST method with BHO?
    N nmhuy

    Hello everybody, I am developing a Browser Help Object in IE and encounter some problems: - Get data sent by POST method from an URL. - Send data to an URL by POST method. How can we accomplish that? Do you have any idea? Thanks. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    ATL / WTL / STL help question

  • Working on POST method with BHO?
    N nmhuy

    Hello everybody, I am developing a Browser Help Object in IE and encounter some problems: - Get data sent by POST method from an URL. - Send data to an URL by POST method. How can we accomplish that? Do you have any ideas or suggestions? Thanks. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    C / C++ / MFC help question

  • Change source control
    N nmhuy

    Hi, I have both Microsoft Source Safe and CVS on my computer. Currently, I use Source Safe as my Source Control and it is integrated into Visual Studio .NET IDE. Now, I want to use CVS as my Source Control. Are there any way to change the source control integrated into Visual Studio .NET IDE? (ie. remove Microsoft Source Safe from and integrate CVS into the IDE). Thanks. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    IT & Infrastructure csharp visual-studio question

  • Access file gets bigger after changes
    N nmhuy

    I opened an MS Access file and made some changes on it (just remove codes). But the file is getting bigger (double size). Are there any way to keep the file smaller? Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    IT & Infrastructure question

  • IE address update
    N nmhuy

    Could you show me an example? Thanks. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    C / C++ / MFC question help announcement

  • IE address update
    N nmhuy

    Hi, everybody, I develop a browser helper object. I need to update the address in the address bar to a different address after user navigates to it. I tried to handle the NavigateComplete event but failed to make change to the address. Any change that makes to the address causes crash in IE. How can I solve this problem? Thanks. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    C / C++ / MFC question help announcement

  • Browser Helper Object
    N nmhuy

    I develope a DLL that is loaded with every instance of Internet Explorer. In the DLL, I want to handle something like "BeforeNavigate" event to get the URL user enter in the Adress Bar. I've written this DLL before in C#. And in C#, handle this event is quite easy, just write something like: WebBrowser browser; browser.BeforeNavigate2 += new DWebBrowserEvents2_BeforeNavigate2EventHandle(this.BeforeNavigate); But now, I have to write it in Visual C++ 6.0. How can I handle this event in Visual C++ 6.0? Hope to see your replies soon. Thanks. Lan hue sau ai lan hue heo Lan hue sau doi trong heo ngoai tuoi

    ATL / WTL / STL c++ question csharp
  • Login

  • Don't have an account? Register

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