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

laksh2204

@laksh2204
About
Posts
18
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • problem in memory allocation for a pointer
    L laksh2204

    Yes, this is exactly what I was trying to do.. Thanks a lot, all of you :-D

    C / C++ / MFC performance help question

  • problem in memory allocation for a pointer
    L laksh2204

    Like this??? void fun(int* ptr){ ptr = (int*)malloc(sizeof(int)); } int main(){ int ptr; fun(&ptr); ptr = 5; cout<<ptr; } I dont think so.. probably you mean something else.. that i am not getting.

    modified on Monday, September 29, 2008 8:40 AM

    C / C++ / MFC performance help question

  • problem in memory allocation for a pointer
    L laksh2204

    ok then what change is required here. so that i can i can put some value into memory allocated in fun() function.

    C / C++ / MFC performance help question

  • problem in memory allocation for a pointer
    L laksh2204

    Hi all, I am getting seg fault when trying this piece of code. I'm not getting what is went wrong here. void fun(int* ptr){ ptr = (int*)malloc(sizeof(int)); } int main(){ int *ptr = NULL; fun(ptr); *ptr = 5; //seg fault cout<<*ptr; }

    C / C++ / MFC performance help question

  • Bitmaps on Tabs of TabControl
    L laksh2204

    chk this link. http://www.codeproject.com/KB/tabs/XPTabApp.aspx?display=Print[^]

    C / C++ / MFC help tutorial question

  • diamond problem and virtual inheritance
    L laksh2204

    I have some queries here.. 1. By making the inheritance virtual how the ambiguity is actually resolved? I mean, what this virtual inheritance does internally? Does it create another vptr of another vtable? if it is so how does the new vtable looks like?? 2. And as the diamond problem says that there is an ambiguity that whether D will have path A->B->D or A->C->D A / \ B C \ / D So after removing ambiguity which path is taken?

    C / C++ / MFC help oop question

  • Array Variable initialization
    L laksh2204

    I think you are trying to do something like this.. class A{ int TModels[3]; public: A():TModels[1](0){} }; int main(){ A a; } which is giving you above error: As per my knowledge there is no (standard) C++ way of doing this. Array initializers do not exist for classes. So prob you can do it somewhat like this: class A{ int TModels[3]; public: A(){ for(int i=0; i<3; i++) TModels[i] = 0; } }; int main(){ A a; } Hope it helps you

    C / C++ / MFC data-structures help tutorial question

  • who can give me a example in C++ using Factory Pattern
    L laksh2204

    Check this link. I hope this will help you. http://www.codeguru.com/forum/showthread.php?t=327982[^]

    C / C++ / MFC c++ design regex architecture tutorial

  • Need help in instantiating abstract class
    L laksh2204

    This is working fine in linux as well But, Did you define the function "baseLinux::bool get()" anywhere? as below: class baseLinux : public Abase { public: virtual bool get(){} } ----- laksh

    C / C++ / MFC help linux question

  • Need your help
    L laksh2204

    I hope this link will help you.... http://datastructures.itgo.com/lists/dynamic/sort.htm[^] However, in c++ you can use stl::list which have its sort function inbuilt. check this... http://msdn.microsoft.com/en-us/library/kz841ss7(VS.71).aspx[^] Laksh

    C / C++ / MFC c++ algorithms data-structures help

  • Array
    L laksh2204

    int main(){ char see[3]; see[0] = 's'; see[1] = 'e'; see[2] = 'e'; // or you can do above 3 steps in loop also for (int a=0; a<3; a++) { cout<<"enter a character:"; cin>>see[i]; } for(int i=0; i<3; i++) { cout<<see[i]; } return 0; } Try this and start with any of book suggested by sandip.

    C / C++ / MFC data-structures help tutorial question

  • WaitForSingleObject and SetEvent
    L laksh2204

    Hi Everyone, I have some confusion with WaitForSingleObject. Is it necessary for a thread to be in wait state to handle an event? for example, Thread1 { SetEvent(event); } Thread2{ while(true) { if(WaitForSingleObject(event, INFINITE)){ SetEvent(event); //event raised again, but handler thread 2 is not in wait now } } } Thanks laksh

    C / C++ / MFC tutorial question

  • Inhertance Diamond problem
    L laksh2204

    OK, thats nice explanation.. one more issue comes into my mind. A / \ B C \ / D In the same diamond structure if my declaration is like: class A; class B : virtual public A; class C : virtual public A; class D : public B, public C; now when i do A *d = new D; //it will work as ambiguity is removed by virtual. But, which path will be followed?? A->B->D or A->C->D?? or something else...

    C / C++ / MFC oop help

  • Inhertance Diamond problem
    L laksh2204

    Hi, I have a very famous problem with multiple inheritance here. class A{ public: A(){ cout<<"A"<

    C / C++ / MFC oop help

  • Function Calling
    L laksh2204

    If you are saying that you have a class and inside that you have a public member function, then you need to create an object of the class at the place where you want to call it. And then using that object you can call the function. You need to include the .h file in which you have created your class. Well this is like targeting in dark.. If you can put the problem in detail. You may get right solution.

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

  • Can I create a process in Windows service in MFC?
    L laksh2204

    I think its not a bad idea in general scenario. But might not be good idea in my scenario. As according to my problem when a particular service is down, the user which is logged in must have a process running which can handle the situation. In this way, that user is required to be logged in permanently. Which for me doesn't seems to be a good idea. In other words, What if no user is logged in and one of those services goes down. No one will be there to handle the situation. However, "Winsta0\default" looks quite different to me. May be like someone who is always there. In this case it should work. I'll try it out. Thanks everyone for your valuable time. This forum is really one of the bests I've ever seen. :)

    C / C++ / MFC help c++ design question

  • Can I create a process in Windows service in MFC?
    L laksh2204

    Actually, I have a service running on Windows Server2003 sp2 called locator. This service keeps a control over another 4 services in the system. If any one of these four is down, I am supposed to run a process say Handler which is yet to be developed. So I was trying with an existing like cmd,calc etc... Now As Mark is saying use CreateProcessAsUser() and lpDesktop, I have a problem that I am new to windows domain. I don't know what should be the value for lpDesktop or for hToken i.e. first parameter of CreateProcessAsUser(). I am getting error 6 INVALID_HANDLE. I think, The discussion stopped due to timezone difference. --Arun

    C / C++ / MFC help c++ design question

  • Can I create a process in Windows service in MFC?
    L laksh2204

    I am trying to do something like this: > STARTUPINFO si; > PROCESS_INFORMATION pi; > BOOL bRes = false; > DWORD dwCode = 0; > ZeroMemory ( &si, sizeof ( STARTUPINFO)); > si.cb = sizeof ( STARTUPINFO); > si.dwFlags = STARTF_USESHOWWINDOW; > si.wShowWindow = SW_SHOWNORMAL; > > bRes = CreateProcess( NULL, > (char *)it->second.c_str(), // some exe > NULL, > NULL, > TRUE, // also tried FALSE > NORMAL_PRIORITY_CLASS, //also tried 0 > NULL, > NULL, > &si, > &pi > ); > DWORD error = GetLastError(); > XERROR1( "ExecuteFailoverCommand :after execution Error=%d", error); > if( bRes == false ) > { > XERROR3( "ExecuteFailoverCommand :Error=%d, Could not invoke process %s > for service %s", error, it->second.c_str(), ServiceName.c_str()); > } > else > { > XTRACE2("ExecuteFailoverCommand : executed command %s on failure of %s > returned %d", it->second.c_str(), ServiceName.c_str(),bRes); > return true; > } This is working fine when I am calling CreateProcess from an exe but same is not working when it is being called from a running service. This may be due to reason that service puts the UI on a different desktop. So, is there any other solution to this problem. thanks in Adv

    C / C++ / MFC help c++ design 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