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
L

L Madhavan

@L Madhavan
About
Posts
29
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to SAVE&EDIT "HINDI" words in JSP & MySql...
    L L Madhavan

    You need to specify a suitable character set for your database, i.e. one which supports the languages that you want to store data in, something like Unicode. See MySQL Character Set Reference[^].

    Web Development help java database mysql com

  • Programming time for algorithm? Anyone help me.................
    L L Madhavan

    I'm not sure what you mean by "count time". If you mean algorithmic complexity, the worst case running time would be O((T - P + 1) * P) because that's the maximum number of times the loops in BruteForce together can execute. A little calculus also shows that the worst occurs when P = (T + 1) / 2, in which case the running time would be O(T2). If you're looking to calculate the actual running time of the function, you should use a library function such as clock()[^] to get the time before and after calling the BruteForce function - then the difference in those times will give you the execution time.

    C / C++ / MFC c++ algorithms help tutorial question

  • Using MFC's socket within the Process' threads
    L L Madhavan

    Oh yes, I missed that point. You do need to detach the original socket.

    C / C++ / MFC c++ algorithms help question

  • To add Meta tag with javascript is good or bad for google search engine
    L L Madhavan

    It makes no sense to add META tags using JavaScript because search engines do not evaluate scripts and hence they will never see those tags.

    Web Development javascript question

  • Should i go for open source or Asp.net technology for web development
    L L Madhavan

    There is nothing such as better or worse. It all depends on what you require and what technologies are available for you to use.

    Web Development ruby csharp php asp-net

  • Using MFC's socket within the Process' threads
    L L Madhavan

    AmitCohen222 wrote:

    if I understand correctly it is since the only thread allowed to use this socket is the one created it

    Not exactly, it's got to do with a bug in MFC. See knowledge base Q193101[^] - I had a similar problem and calling AfxSocketInit() in each thread fixed it.

    C / C++ / MFC c++ algorithms help question

  • mciSendString problem
    L L Madhavan

    I believe it might have something to do with not having a "window" to play the video in. It might be simpler to use the MCIWnd functions (I've used them and had no problem in playing videos) compared to sending command strings yourself.

    C / C++ / MFC help question

  • C programming in Linux warning message
    L L Madhavan

    You're partially right about the *opt_socket_name[5] thing. You declare the array of pointers using a *, eg. char *opt_socket_name[5]. Now, for a normal pointer, you would assign it the address of an existing variable. Example:

    int value = 10;
    int *pointer = &value;
    printf("%d\n", *pointer);

    But the problem is that there is no string data type in C. A string itself is an array of characters and an array is internally a pointer, which means that a string is already a pointer. So the & and * are not used at all. This is how you would use an array of strings:

    main() {
    int i;
    char *opt_socket_name[5];

    char string1[10];
    // ...
    char string5[10];

    strcpy(string1, "hello 1");
    // ...
    strcpy(string5, "hello 5");

    opt_socket_name[0] = string1;
    // ...
    opt_socket_name[4] = string5;

    for (i = 0; i < 5; i++)
    printf("%s\n", opt_socket_name[i]);
    }

    Linux, Apache, MySQL, PHP question help linux testing

  • help..
    L L Madhavan

    Try New Project > Win32 Console Application.

    C / C++ / MFC help c++

  • downloading DSL
    L L Madhavan

    Go to http://damnsmalllinux.org/download.html[^], select any of the mirrors, then go to the current folder and download current.iso. Burn the image onto a CD, then reboot your system and the DSL live CD should load.

    Linux, Apache, MySQL, PHP question linux help

  • Linux web proxy
    L L Madhavan

    For questions 1 and 3: If you're familiar with Linux, yes, it's enough you read up the chapter on squid. I also found a simple tutorial here[^]. For question 2: Generally, you need two. One connects the proxy server to the local network. Another connects it to the internet, unless you're using an interface other than Ethernet.

    Linux, Apache, MySQL, PHP question sysadmin linux help announcement

  • C programming in Linux warning message
    L L Madhavan

    It looks like you're trying to copy text into a string, but there are quite a few mistakes in the code: 1. A string is an array of characters, for eg. char str[100]. Therefore opt_socket_name[5] is a string that can hold 4 characters (+1 for the null terminator) 3. A * represents a pointer - you can also use a character pointer as a string, but it would point to an existing array of characters. 4. You use either * or an array. In your case, *opt_socket_name[5] means an array of 5 strings. 5. const = constant. Don't use that unless you don't want to modify the string. So here's what your code should look like:

    static char opt_socket_name[20];

    main()
    {
    strcpy(opt_socket_name, "testing");
    printf("%s", opt_socket_name);
    }

    If you're looking for an explanation for your warning and the segmentation fault, here it is: as I mentioned, in your original program, opt_socket_name[i] is a string and *opt_socket_name[i] points to a single character in the string. What you are passing to strcpy is a single character, which in C can be implicitly typecast to an integer, which in turn is typecast to a pointer and hence the warning.

    Linux, Apache, MySQL, PHP question help linux testing

  • Redrawing..
    L L Madhavan

    Looks like the Draw method is using an XOR pen, which is a common method for drawing shapes. An XOR operation is similar to inverting the colours, so by drawing it the second time, you effectively erase the old shape before drawing the shape at the new position.

    C / C++ / MFC com graphics hosting question

  • ShellExecute with new instance
    L L Madhavan

    You will have to retrieve the path to the default browser and directly execute it, passing in the URL as a parameter.

    ShellExecute(this->m_hWnd, _T("open"), pathToBrowser, _T("www.xyz.com"), NULL, SW_SHOWNORMAL);

    C / C++ / MFC com

  • checkmark/icon in submenu[owner draw menu]
    L L Madhavan

    Shift the rectangle by the icon dimensions, say 16 pixels to the right, then draw the text there. Now draw the icon at the original position.

    CRect rect;
    rect.left=lpDrawItemStruct->rcItem.left;
    rect.top=lpDrawItemStruct->rcItem.top + 2;
    rect.right=lpDrawItemStruct->rcItem.right;
    rect.bottom=lpDrawItemStruct->rcItem.bottom + 2;

    // Put code here to draw icon at (rect.left, rect.top)

    // Now shift the rectangle before drawing text
    rect.OffsetRect(16, 0);

    //str is a string which i want to output : eg -> Open\tCtrl+O
    pDC->DrawText (str,rectt,nFormat); //this will draw text into the menu/submenu

    You can load standard images such as check mark etc. using LoadBitmap[^]

    C / C++ / MFC graphics help question

  • PHP editor?
    L L Madhavan

    If you just want a simple editor, try Bluefish[^]. If you want a complete IDE (including debugging etc.) try Eclipse PDT[^].

    Linux, Apache, MySQL, PHP php visual-studio linux question

  • checkmark/icon in submenu[owner draw menu]
    L L Madhavan

    What problem are you facing in drawing the icon? You can use DrawIconEx[^] and pass in the DC from the DRAWITEMSTRUCT.

    C / C++ / MFC graphics help question

  • Embded media player
    L L Madhavan

    B87 wrote:

    i uploaded this in server but some formats which can play in my system cant supported in other systems

    Embedded objects run on the client side, so the supported formats depend on the codecs that are installed on the client's system. The best solution to this is to simply use a standard format such as MP3 or WMA so that it plays on all systems.

    Web Development com sysadmin help

  • using _ultoa_s is creating a problem
    L L Madhavan

    strlen returns the current length of the string, not the actual size of the buffer. Moreover, if the buffer is uninitialized, (i.e. no null terminator) the behaviour of strlen is undefined.

    C / C++ / MFC database help

  • How to open localhost in MFC? (Very Urgent...........) [modified]
    L L Madhavan

    Maybe the CInternetSession[^] class will help you. The OpenURL function of this class opens any Internet file and returns a CStdioFile object, which you can use as a normal file object. If you want to save the file, simply read from this file and write into another file.

    C / C++ / MFC c++ help tutorial question
  • Login

  • Don't have an account? Register

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