C++ :: Moving Focus In Each Loop Iteration - Directly Come Last Item After Completion

May 17, 2012

I have a strange problem in using C code. I want to move focus from one item to another in a keypress event (like keydown)in loop. But it move directly to the last item

Details: In the code segment, I am generating keypress event explicitly from code and want to move focus for number of items inside loop. Loop is working properly, but output is also generated after completion of loop and focus is directly coming on last item in list not showing intermediate movements. Voice output using espeak is generated correctly in each iteration.

Tryouts: I have tried to call a dilog box which take yes/no event by Btn press,that works fine. That means event generation in code is giving problem, it needs h/w intervention for keypress (As I understood)..

View 10 Replies


ADVERTISEMENT

C++ ::  Making A Moving Item Controlled By Using WASD

Mar 21, 2013

I'm working on a personal project with a screen that looks like this:

+++++
+++++
++O++
+++++
+++++

And below that it asks where you want to move. I've done the majority of the work, I just have to figure out how to actually move the O. Here's my source code:

#include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;

[Code]....

View 2 Replies View Related

Visual C++ :: Token Going Null On Second Iteration Of Loop

Jan 23, 2013

Code:
while(!pile.eof()){
pile.getline(inputbuff,199,'
');
count++;

[Code] ....

the loop iterates the first time through qualifying for (count % 2 != 0) because count is at 1 so it stores the characters after the comma into tok and does it successfully according to my debugger.then the while itterates again because it doesn't qualify for the next if. this time it does qualify for count % 2 == 0 but my tok pointer is now null , how can that be? does it go null when the while loop itterates for the second time? that shouldn't be because my integer count doesn't reset?

View 4 Replies View Related

C# :: Making Moving Button Or Moving Picture Box Clickable?

Jun 13, 2014

i want to make moving button or moving box clickable as i am making a game in which i move picture boxes and user clicks on it and his scores increases. but i was unable to do so , so i tried the same concept with buttons but no results.

View 7 Replies View Related

C++ :: Does Not Have Auto Completion For Curly Braces

Jan 6, 2013

I presently use the turbo C++ IDE. it has the red background(changeable) and all that but it does not have auto completion for curly braces.

View 19 Replies View Related

C/C++ :: Iteration Through Enumerated Type

Dec 7, 2014

I cannot figure out how to iterate and enumerated type. So the question that I am trying to solve is this:

Write an enumerated type definition for the four seasons, starting with Winter and ending with Autumn

View 2 Replies View Related

C :: Iteration Bound Determination - Get Result Correct Upto N Decimal Places

Mar 26, 2013

suppose I want to find the value of e ,e^x or sin(x) or any such function in general ,through their infinite series (maclaurin or taylor) how many iteration should I have to make to get the result correct uptu 'n' decimal places?

View 6 Replies View Related

Visual C++ :: Enable / Disable Menu Item 2 In OnUpdate Handler Of Menu Item 1?

Sep 15, 2014

I have two menu items. When item 1 is disabled, I want item 2 to be disabled as well. In the OnUpdate handler of menu item 1, I have tried to use "t_pMenu = pCmdUI->m_pMenu;", "t_pMenu = pCmdUI->m_pSubMenu;" and "t_pMenu = pCmdUI->m_pParentMenu;" but I always get NULL t_pMenu. How can I achieve this purpose?

Code:
void CDummyView::OnUpdateMenuItem1(CCmdUI* pCmdUI)
{
if(m_bShowMenuItem1) {
pCmdUI->Enable(TRUE);

[Code]....

View 14 Replies View Related

Visual C++ :: How To Set Focus After Using Alt Tab

May 22, 2014

Using mfc I have an application where I'm not allowed to use a mouse and alt+tab will be regularly used. Using alt+tab to come back to my application kills the focus in the view. Once my application comes back to the foreground how can I set the view as the focus?

View 3 Replies View Related

C# :: Changing Focus Using Program PID

Apr 17, 2014

For the past couple days I've been making small improvements on a program I made to keep track of a battle count while playing a game. Mainly to reduce the chore of keeping track yourself while you're playing. But it still becomes a hassle to switch back and forth between the program and your game and I was hoping to be able to set focus to the game after the BattleCount method is called.

Currently I am importing a DLL that somebody recommended I use to make a ActiveProcess method that accepts a integer as a parameter which would set the PID but it doesn't seem to be working. The two methods are as follows.

private void countDownClick(object sender, RoutedEventArgs e) {
//Calls a method within my class that subtracts and adds battle values.
counter.CalculateBattles();

//These two change text on my WPF forms with accessor values from my class.
battlesWonText.Text = counter.BattlesWon.ToString();
battlesLeftText.Text = counter.BattlesLeft.ToString();

[Code] ....

This is the C++ code they told me to use to set focus to another application using a PID.

[DllImport("user32.dll")]
static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
const UInt32 SWP_NOSIZE = 0x0001;
const UInt32 SWP_NOMOVE = 0x0002;
const UInt32 SWP_SHOWWINDOW = 0x0040;

[Code] ....

I'm simply trying to figure out how to set focus to a foreign program using their PID and a button click event in WPF. I'm using Visual Studio 2012 on Windows 7.

View 4 Replies View Related

C# :: Read Barcode Without Having The Focus On Text Box Using WPF

Sep 4, 2014

I want to read the bar code using USB scanner without having the focus on text box using WPF. I have searched around online but not found related answers, I think it is the correct place to post my question.

View 5 Replies View Related

C# :: Select Text When TextBox Gets Focus Or Becomes Active

May 9, 2013

I can select the textbox #2 text with this.

this.tB2.Click += new System.EventHandler(tB2_Click);

private void tB2_Click(object sender, System.EventArgs e) {
tB2.SelectAll();
}

What would be the simplest way to do the same for all textboxes on the form, preferably on both click and enter events.

View 12 Replies View Related

C Sharp :: To Get Child Window Of MDI Page In Focus On Pressing ALT TAB

Dec 7, 2012

I have MDI form which contains mutliple tabs and each tab has its own child form . When user presses ALT TAB from the from to other application its fine but when users presses ALT TAB back to my application it should keep focus on child form last time it was selected.

View 1 Replies View Related

C :: Reading RAM Memory Directly

Mar 27, 2014

Is there any way to read RAM memory directly. For say i want to access memory location 0x0100 to 0x120. How to do that. how to declare the variable, is it unsigned int. what is the type of read values it hex or ascii. how t cast it.

View 2 Replies View Related

C# :: Publishing App Directly To Website

Mar 25, 2014

I'm successfully publishing an app to my website by publishing locally and then uploading the files but one of the options offered is to publish straight to the web site but I can't find anywhere to enter a user name and password for my web site. I could also do it with ftp but since the option is offered to publish directly to the web site I'd like to try that method. I'm using the Click Once method.

View 5 Replies View Related

C :: Convert A Character Directly To A String

Nov 25, 2013

I wish to convert a character directly to a string for a top-secret project I'm working on. It needs to be portable across various machines with different sized Indians.

Code:

#include <stdio.h>
int main(void)
{
const int i = 0x0041;
const char *str_p = (char *) &i;
}

[code]....

I want this to output an 'A', but I'm not sure this code will work on my friend's mom's S/360.

View 2 Replies View Related

C++ :: How To Open Finished Program Directly

Mar 5, 2014

I don't know how to put this really, but I finished a program in Qt, and i want to know how to make a .exe file for it, so i dont have to open Qt and build the program every time i use it.

View 2 Replies View Related

C++ :: Cast Directly Between Base Classes Of Object?

Jul 1, 2013

I've got two classes, which are both derived from the same two base classes. Here's a representation of the actual code:

Code: #include <vector>
class BaseClassA {
};
class BaseClassB {
};
class TestClassX
: public BaseClassA,
public BaseClassB

[code].....

Basically, I'd like to know if it is possible to cast directly from a BaseClassA pointer to a BaseClassB pointer, without casting to the child class first.

View 10 Replies View Related

C++ :: Initializing Array Of Char Pointers Directly

Nov 24, 2014

I'm learning OpenGL using the C API and some of the functions' argument types have proven a bit challenging to me.

One example is the function Code: glShaderSource(GLuint shader, GLsizei count, GLchar const** string, GLint const* length); It resides in foo() which receives a vector "data" from elsewhere Code: void foo(std::vector<std::pair<GLenum, GLchar const*>> const& data); To pass the pair's second element to glShaderSource's third argument, I do the following:

Code:

GLchar const* const source[] = {data[0].second};
glShaderSource(..., ..., source, ...);

Now I have two questions regarding this:

1. Can I initialize a char const** via initialization list, the way I do a char const*?

Code:

// this works
std::vector<std::pair<GLenum, GLchar const*>> const shader_sources = {
{GL_VERTEX_SHADER, "sourcecode"},
{GL_FRAGMENT_SHADER, "sourcecode"}
};
// but is this possible?

std::vector<std::pair<GLenum, GLchar const**>> = { ??? };

2. Is there an alternative to creating a temporary GLchar**, even though that's specifically what the function wants?

View 2 Replies View Related

C :: How To Read File Directly From Memory Buffer

Jan 20, 2014

I have a C program. Within it, I would like to embed either a file or a pre-assigned variable. I would prefer a method that is platform independent.

I am using the data type "RSA" from <openssl/rsa.h>. I have a key file in PEM format, but I would like to embed an RSA object in the program instead. I tried creating a char array and then casting the pointer, but that caused some sort of illegal casting issue. I tried using memcpy but I haven't been able to get it working that way. What is the best way of going about this? Is it possible to read a file directly from a memory buffer?

View 1 Replies View Related

C :: Directly Create Dynamic String From Stdin

Sep 14, 2014

Is it possible to create a dynamic char array on the fly directly from stdin? I do not want to create a fixed length array before hand and then copy contents of it into a malloc created array.

Code: //[1]
char line[MAX1];
gets(line);

[Code]....

I could do either [1](buffer overflow problem) or [2] and then goto [3]. But both will have a problem if the input is more than the size MAX1(use defined).

Is it possible to do something of the effect of readLine() method of BufferedReader class in Java or the Console.readLine in .NET? Is it possible to peek into stdin and see the size of the input and then creat an array of the same exact size?

View 8 Replies View Related

C++ :: Using Class Member Directly In Header File

Jan 26, 2015

I'm trying to use a class member to initialize the dimension of a matrix. I have two issues. Here is the code (.h) simplified :

#include <vector>
#include <array>
#include <typeinfo>

template<typename T, std::size_t N>
struct md_vector {

[Code] ...

error: invalid use of non-static data member ‘OptimalSamplingStrategy::_nbMorph’|

I can't use a class member directly in the header file (here _nbMorph).

It was an issue I got before and that I didn't solve as I succeed in finding other ways. I don't think it's possible here.

View 1 Replies View Related

C# :: Exporting Data From SQL Database To Excel Directly?

Apr 19, 2014

Exporting the data from the sql database to excel directly.this code is not working and i am not getting file in particular location. My connection string is :

Data Source=aswin-pcsqlexpress;Initial Catalog=pro;Integrated Security=True

using Excel=Microsoft.Office.Interop.Excel;
using System.Runtime.InteropServices;
namespace WindowsFormsApplication5 {
public partial class Form1 : Form {
SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["SqlCon"].ToString());

[code]....

View 1 Replies View Related

C++ :: Polymorphism On Class Instance Is Not Directly Applicable To Array

Mar 19, 2013

Below code produces run-time segmentation fault (core dumped) when execution reached line 53: delete [] array

Code 1:

#include <cstdlib>
#include <iostream>
using namespace std;
#define QUANTITY 5
class Parent {
protected:
int ID;

[Code] ....

Output of code 1:

Constructor of A: Instance created with ID=1804289383
Constructor of A: Instance created with ID=846930886
Constructor of A: Instance created with ID=1681692777
Constructor of A: Instance created with ID=1714636915
Constructor of A: Instance created with ID=1957747793
A::showID() -- ID is 1804289383
A::showID() -- ID is 846930886
A::showID() -- ID is 1681692777
A::showID() -- ID is 1714636915
A::showID() -- ID is 1957747793
Try to delete [] array..
Segmentation fault (core dumped)

Question: Why does segmentation fault happen in code 1 above?

View 9 Replies View Related

C# :: Change Settings In User Config Of Different Applications Directly

Jan 10, 2014

I have a service that has some settings. As the service is running as a system user, the settings file is located in

C:Windowssystem32configsystemprofileAppDataLocal<PRODUCTNAME><ExecutableName+GUID><VERSION>user.config

Now i want to be able to change some settings at runtime using a normal Winforms App. Is there a good and easy way to change the user.config of a different application directly? I tried with ConfigurationManager but that does not seem to work.

View 8 Replies View Related

Visual C++ :: How To Directly Pass Wstring (literal) To Function

Feb 5, 2013

I am wondering if I have the following parameter to pass in to a function

Code : void Load(std::wstring filename);

This statement is wrong.

Code : Load("DataMesh.x");

I don't want to pre-declare a variable. How do I directly pass a wstring (literal) to this function.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved