Search Results

Search found 4 results on 1 pages for 'vinaym'.

Page 1/1 | 1 

  • putenv/setenv using substitutions

    - by vinaym
    I need user to define all the environment variables needed for my program in a text file as shown below. MyDLLPath = C:\MyDLLPath MyOption = Option1 PATH = %MyDLLPath%;%PATH%; In my program I read each line and call putenv with the string. Problem is that the environment substitutions (%MyDLLPath%) are not being expanded. I am guessing the following fix for that 1. Check each line for % characters. 2. Get the text between 2 consecutive % characters. 3. Call getenv using the text from step 2. 4. Replace value obtained above into the line and then call putenv. Is there a better way to do it?

    Read the article

  • putenv/setenv using substitutions

    - by vinaym
    I need user to define all the environment variables needed for my program in a text file as shown below. MyDLLPath = C:\MyDLLPath MyOption = Option1 PATH = %MyDLLPath%;%PATH%; In my program I read each line and call putenv with the string. Problem is that the environment substitutions (%MyDLLPath%) are not being expanded. I am guessing the following fix for that - Check each line for % characters.- Get the text between 2 consecutive % characters.- Call getenv using the text- Replace value obtained above into the line and then call putenv. Is there a better way to do it?

    Read the article

  • How to find item selected from customContextMenuRequested() on QTreeView item?

    - by vinaym
    I have implemented contextual menus in QTreeView items with the following code MyDerivedQTreeView->setModel(MyDerivedQAbstractItemModel); MyDerivedQTreeView->setContextMenuPolicy(Qt::CustomContextMenu); connect(MyDerivedQTreeView, SIGNAL(customContextMenuRequested(const QPoint &)), MyDerivedQAbstractItemModel(), SLOT(contextualMenu(const QPoint &))); void MyDerivedQAbstractItemModel::contextualMenu(const QPoint& point) { QMenu *menu = new QMenu; menu->addAction(QString("Test Item"), this, SLOT(test_slot())); menu->exec(MyDerivedQTreeView->mapToGlobal(point)); } MyDerivedQAbstractItemModel::contextualMenu() gets called and I can see the contextual menu. Problem is contextual menu should be visible only if user right-clicks on an item and it should be customized as per the item selected. How do I get whether/which item is selected from QPoint information? I am on Qt 4.5.3.

    Read the article

  • how to copy files without showing dos window

    - by vinaym
    I have the following code to copy files sprintf(command, "copy /Y %s %s", sourceFile, targetFile); system(command); It works except for the dos window showing up which is very annoying. I am trying to use CreateProcess() (with an #ifdef for WINNT), but not sure how to setup the command line for the same. Any other options for copying files in C (on windows) without showing dos window?

    Read the article

1