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
M

Member 9350237

@Member 9350237
About
Posts
37
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Adding UI to an existing console project using windows form
    M Member 9350237

    Thank you so much for the information

    C / C++ / MFC design

  • Adding UI to an existing console project using windows form
    M Member 9350237

    Thank you very much for the information

    C / C++ / MFC design

  • Adding UI to an existing console project using windows form
    M Member 9350237

    Hi all!, I'm planning to create a windows form based UI to my existing console project. Would be great if someone can give a detailed step-wise procedure for the same. Here is the part of my code shows what all parameters I need to get through console:

    printf ("\n");
    printf ("-----------------------------------\n");
    printf ("\n\n");

    printf ("Dyad name:");
    scanf("%s",fname);
    printf ("\\n\\n");
    
        printf ("Epoch number \[1-%d\]:",NEPOCHS);
    scanf("%d",&epoch);
    printf ("\\n\\n");
    
    printf("Group: Haptic (0) or Visuo-haptic (1):");
    scanf("%d",&lineEnable);
    printf ("\\n\\n");
    
    switch(lineEnable){
    case 0: // Haptic
    	strcpy(prefix,"haptic");
    	break;
    case 1: // Visuo-Haptic
    	strcpy(prefix,"visuohaptic");
    }
    
    printf ("\\n\\n");	
    printf ("\[x\] - Exit application\\n");
    printf ("\\n\\n");
    

    Thank you!

    C / C++ / MFC design

  • using 'mkdir' for creating new directory
    M Member 9350237

    That helps!. Thank you so much :)

    Managed C++/CLI help tutorial question

  • using 'mkdir' for creating new directory
    M Member 9350237

    Hi Guys!, I'm developing program which receives name from user and create a new directory, then I've to a file with different name to that directory.. Idea is something like this: 1. Name of directory to be created : 2. Name of file : this file need to be saved to the created directory I came across the use of 'mkdir', but i dont know how to use it properly Can someone help me on this? Thank you

    Managed C++/CLI help tutorial question

  • runtime error due to corruption of heap
    M Member 9350237

    This is my main program..I'm sorry to post whole bunch of code here!, but I'm wondering this may helps someone can pointout the issue

    int main(int argc, char* argv[])
    {

    char fname\[30\];
    char fpath\[100\]; // file name for logging
    char fpath1\[100\]; // file name for logging
    char fpath2\[100\];
    
    
    // implimentation for genrating force enable bool array
    memset(boolArray,0,sizeof(bool)\*arraySize);
    
    bool \*pBool =boolArray + 10;
    srand( (unsigned)time(NULL));
    int rIndex2;
    
    for(int i=0;i<10;++i){
    
    	memset(pBool,1,sizeof(bool)\*12);
    	//memset(pBool,1,sizeof(bool));
    	int rIndex = rand()%12;
    
    	pBool\[rIndex\]=0;
    		do{
    			//int rIndex2;
    		
    			rIndex2 = rand()%12;
    			pBool\[rIndex2\]=0;
    	      } while (rIndex2==rIndex);
    	//pBool = rand()%2;
    	pBool +=12;
    }
     
    for (int j=0; jgetNumDevices();
    
    // limit the number of devices to MAX\_DEVICES
    numHapticDevices = cMin(numHapticDevices, MAX\_DEVICES);
    
    
    //-----------------------------------------------------------------------
    // 3D - SCENEGRAPH
    //-----------------------------------------------------------------------
    
    
    //Seperated into two if s
    
    C / C++ / MFC help

  • runtime error due to corruption of heap
    M Member 9350237

    Hi Guys!, I'm getting a runtime error, and compiler is pointing at "free.c", shown below:

    void __cdecl _free_base (void * pBlock)
    {

        int retval = 0;
    
    
        if (pBlock == NULL)
            return;
    
        RTCCALLBACK(\_RTC\_Free\_hook, (pBlock, 0));
        retval = HeapFree(\_crtheap, 0, pBlock);
        if (retval == 0)
        {
            errno = \_get\_errno\_from\_oserr(GetLastError());
        }
    

    }

    I couldn't troubleshoot where exactly is the issue.. It would be of great help if you can give some suggestions.. Thanks!

    C / C++ / MFC help

  • adding pointer arrays
    M Member 9350237

    Thanks a lot!! Now it's working fine :) Many thanks again!!

    Managed C++/CLI data-structures question

  • adding pointer arrays
    M Member 9350237

    Thanks a lot!!, I'm wondering how to set random zeros and ones to pBool pointer! you mean

    pBool = rand()%2;

    Still bit confused! As I mentioned , for each set I have 12 numbers, out of which 10 numbers 'must' be 1 and 2 0s have to be put randomly into this block of ones, so total of 12: One set should be like this {1,1,1,1,0,1,1,0,1,1,1,1,...} and in the 2nd set there must be 10 ones and 2 zeros , but position of zero will be different. will be great if you can help me out on this!

    Managed C++/CLI data-structures question

  • adding pointer arrays
    M Member 9350237

    Thanks for responding!. Sorry about my poor explanation.. I think I conveyed it a wrong way. I'm still in a confusion! Let me try to explain the scenario.. Ultimately I need to make a bool array of length 10+120+20=150.This will be combinations of zeros and ones.. Out of which first 10 and last 20 positions are filled with '0'. 120 positions are divided into 10 sets of 12 members.. out of 12 positions 10 are ones and two zeros have to be randomly placed into this 12 locations.. for exp: Following are 1st and last set of 12 positions.. {1,1,1,1,0,1,1,1,1,0,1,1,.....1,1,0,1,1,1,0,1,1,1,1,1} I'm bit stuck implementing this bool array... As I mentined before

    int baseline1[10], int baseline2[20]

    are 1st 10 and last 20 positions of the bool array which is basically '0', {0}..

    int training[120]

    is to be assigend with zeros and ones in such a way that..

    int catcht[20]

    array of zeros to be combined with array [120] as I mentioned before.. Sorry if my explanation is vague!

    Managed C++/CLI data-structures question

  • adding pointer arrays
    M Member 9350237

    Hi Guys, I have to make a single bool array combining four integer arrays as follows. I'm not supposed to do as

    connected = new bool [bl1 + bl2 + tr + ct];

    because bl1, bl2,tr,ct are pointer to arrays. Can some one give a solution for this?? Here is my code:

    class Protocol{

    int baseline1\[10\],baseline2\[10\];
    int catcht\[20\];
    int training\[120\];
    
    bool \*connected;
    

    public:
    Protocol(int[10],int[10],int[120],int[20]);
    };

    #include "protocol.h"
    #include "math.h"

    Protocol::Protocol(int bl1[10], int bl2[10], int tr[120], int ct[20]){

    int \*baseline1 = bl1;
    int \*baseline2 = bl2; 
    int \*training  = tr;
    int \*catcht    = ct;
    
    connected = new bool \[bl1 + bl2 + tr + ct\];
    

    }

    Thank you!

    Managed C++/CLI data-structures question

  • Creating GUI on existing in VC++ 2010 project
    M Member 9350237

    Thank you!. I have been trying to convert my console application to windows form application. While running I'm getting an error, following is the part of my main function..

    int main(array ^args)
    {

    Application::EnableVisualStyles();
    Application::SetCompatibleTextRenderingDefault(false);

    char fname\[30\];
    char fpath\[100\]; // file name for logging
    char fpath1\[100\]; // file name for logging
    
    //disable force field for first half of trial 
    for(int i=0;i
    

    This was the error. I tried changing 'main' as 'WinMain' but it's not preceeding

    error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup

    any suggestion greatly appreciated.

    C / C++ / MFC c++ beta-testing help tutorial code-review

  • Creating GUI on existing in VC++ 2010 project
    M Member 9350237

    Thank you! Sorry about my poor explanation!, The working on a project which is windows console application. But as per my understanding, GUI can be only done in 'Windows Forms Applications'. Will it be possible to change console applications to windows forms application, where I can find all tools for creating GUI??

    C / C++ / MFC c++ beta-testing help tutorial code-review

  • Creating GUI on existing in VC++ 2010 project
    M Member 9350237

    Hi guys!, I'm developing an application using a library in VC++ 2010. I don't have previous experience in GUI programming. So I'm wondering how to begin with on my existing project. It's an tracking experiment where I need to set various parameters initially for the specific task in GUI. Once I set all parameters, GUI have to create a file containing all those parameters and have to pass to the project. It would be of great help if you could give feedback, Thanks!

    C / C++ / MFC c++ beta-testing help tutorial code-review

  • Calculating average in a high priority thread
    M Member 9350237

    Thank you!. I have already seen some implementation of moving average. But I'm not sure about how to implement for my application. Since it's in a thread which is executing at 8Khz, I'm wondering how to store forces trial by trial and to take avareage?

    C / C++ / MFC game-dev help question

  • Calculating average in a high priority thread
    M Member 9350237

    my bad!, just removed

    C / C++ / MFC game-dev help question

  • Calculating average in a high priority thread
    M Member 9350237

    Hi Guys!, I'm developing a simple tracking game using two haptic devices as controllers. Haptic rendering is executed in a high priority thread. During the experiment, force experienced will depends on the position of each player, it's calculated as follows:

    coupledForce1 = cMul(Kp, (newPosition2-newPosition1))-(cMul(Kb, (linearVelocity1)));

    coupledForce2 = cMul(Kp, (newPosition1-newPosition2))-(cMul(Kb, (linearVelocity2)));

    I have 100 trials of tracking tasks and I have to calculate the average interaction force during each trial. How it can be done? my issue is: this manipulation have to be done in a thread with execution rate of around 8KHz Thanks!

    C / C++ / MFC game-dev help question

  • Error running debugger from Visual studio 2010
    M Member 9350237

    It build successfully. But if I try running the debug application within Visual studio (by key F5) I can't proceed.

    C / C++ / MFC help visual-studio debugging csharp tutorial

  • Error running debugger from Visual studio 2010
    M Member 9350237

    Hi Guys, I have a weird problem debugging my project. I have upgraded my VS 2008 project to VS 2010 by opening the solution file and successfully built the project (debug and release configurations). But when I run the project within Visual Studio I get the following weird error saying: "Unable to start program" "System cannot find the file specified" Anyone knows hows how to fix this issue. thanks

    C / C++ / MFC help visual-studio debugging csharp tutorial

  • Build errors !
    M Member 9350237

    Sorry I think the format got changed. Basically compiler pointing at forth line from last end of this structure

    struct StateHandler(0), DummyExplicitSpecialization>
    : StateHandlerBase

    struct StateHandlerBase
    {
    SharedData data;
    States state;
    Transitions *m_interfaces[static_cast<size_t>(Size)];
    StateHandlerBase()
    : data(SharedData()),
    state(static_cast<States>(InitState))/*, m_interfaces({0})*/
    {
    }

    };
    
    typedef int DummyExplicitSpecialization;
    template <States stateParam, class Dummy=DummyExplicitSpecialization>
    struct StateHandler
        : StateHandler<static\_cast<States>(static\_cast<size\_t>(stateParam)-1)>
    {
        TransitionImplement<StateMachineComponents, static\_cast<States>(stateParam)> m\_interface;
        StateHandler() : m\_interface(StateHandlerBase::state, StateHandlerBase::data)
        {
            StateHandlerBase::m\_interfaces\[static\_cast<size\_t>(stateParam)\] = &m\_interface;
        }
    };
    
    template <class DummyExplicitSpecialization>
    struct StateHandler<static\_cast<States>(0), DummyExplicitSpecialization>
        : StateHandlerBase
    {
        TransitionImplement<StateMachineComponents, static\_cast<States>(0)> m\_interface;
        StateHandler() : m\_interface(StateHandlerBase::state, StateHandlerBase::data)
        {
            StateHandlerBase::m\_interfaces\[0\] = &m\_interface;
        }
    };
    
    typedef StateHandler<static\_cast<States>(TerminateState), DummyExplicitSpecialization> StateHanlderType;
    

    StateHanlderType StateHanlderInstance;

    C / C++ / MFC help visual-studio com 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