Visual C++ :: Conditional Compilation Based On Whether It Is Windows 7 Or 8?

Apr 10, 2013

I want to do conditional compilation based on whether it is windows 7 or windows 8. Here is the code below.

#if (_WIN32_WINNT >= 0x0602) //Condition to check whether it windows 7 or 8 .Based on this we can load msxml 3 or 6.
#import <msxml6.dll>
#else
#import <msxml3.dll>
#endif

Im building the above code in windows 8 machine.

Issue here is _WIN32_WINNT should have a value 0x0602, it means it is running in windows 8 machine.Instead it has a value 0x0601 (Means it is taking windows version as windows 7 defined in sdkddkver.h).Im not sure after installing windows 8 sdk im not able to see any include or lib files in the path below C:Program Files (x86)Microsoft SDKsWindowsv8.0A . but i can see all include and lib files of sdk version v7.0A available although i did not installed it.

View 5 Replies


ADVERTISEMENT

C :: How To Retain Dos Windows After Compilation Is Done

Apr 2, 2013

i am just making some new programmings and testing it. But every time after compile and run The dos window is closing and again I have to compile And run command so i want The dos windows should prompt me for next input rather than closing.

View 2 Replies View Related

Visual C++ :: Compatibility Of MFC-based Automation?

May 17, 2013

[URL] if I using Visual Studio Class Wizard to create MFC class based on Microsoft Word 97 type library Msword8.olb. Then will the final application works with higher versions, such as Word 2003, 2007, 2010 and 2013?

View 5 Replies View Related

Visual C++ :: Using CDHtmlDialog In MFC Dialog Based Project

Aug 30, 2013

I am trying to use CDHtmlDialog in a MFC dialog based project.

What i want to achieve is pretty sample. Have one image, one button and one text box in the HTML page.

And then dynamically change this based on a timer. i.e., there're multiple images in the folder and it will change every seconds. Once the button is clicked, the timer stops and no more image changes. Same time when image changes the text in the text box also should change.

I know this is pretty simple, but for some reason i am not able to make the image even display in the dialog.

I am using Visual Studio 2012 in Windows 7 machine.

View 4 Replies View Related

Visual C++ :: Updating To New Windows SDK?

Apr 27, 2013

I've just integrated the Windows SDK V7.0A into my VS2005 application, and I'm getting the dreaded "Application configuration error" when I try to run it on an XP machine.

It runs fine on the development machine, and some customer machines (Win7 and Win8), but will not run on XP due to missing/incorrect version dlls.

I've rebuilt all my libraries, but still no joy.

So, my first question is - If I upgrade the Windows SDK to V7.0A, do I also need to use MFC 10 and msvcrt10, or can I stick with MFC 8?

The next question is, how do I find out which dlls are missing, and which libraries or other dlls are requesting the missing versions?

View 11 Replies View Related

Visual C++ :: Deactivated All Windows Unless ONE

Apr 17, 2013

In my application I have some type of windows showed in an instance of time, and an action shows a new one that i want have the focus all the time , in the way that i can't works with no one of the others. They all are windows, child windows an modeless dialogs, but i don't know how to do. I try use EnableWindow(FALSE) that all the others windows and dialogs, but not works.

View 2 Replies View Related

Visual C++ :: MFC Dialog Based Application Connect With MYSQL

May 20, 2014

I'm using VS 2012. Installed MYSQL 5.6, C++ Connector 1.1.3. Created a sample table using mysql. Now i like to create a connect between mysql and MFC dialog. Using this, i was try to connect.

Server Explorer -> Data Connection -> Add Connections ->MYSQL Database -> Addconnection

To get the connection, i want to enter the connection settings like:

server host name = localhost, user name =root, password=

If I pressed any letter in the keyboard means add connection dialog was closed automatically.

How to connect mysql(localhost) with MFC Dialog?

View 14 Replies View Related

Visual C++ :: Rearrange Controls In Controlbar Based On New Size?

Feb 3, 2014

I have to rearrange my controls in a controlbar based on the new size resulting from dock/undocking of the bars or resizing of the mainframe.

Is there a message I can use? How to determine the new height when docked?

I tried to use its OnSize-function. The problem with it is to get the new height. When the function is called, the height I get from GetWindowRect is the old height.

Is there a better function than OnSize() ?

View 3 Replies View Related

C :: How To Use Conditional Operator

Jan 25, 2013

i know

Code: (condition) ? true-clause : false-clause

but how do you use an array as the condition, how will the code look?For example i want to write

Code:

string numbers[5] = {"one","two","three","four","five"};
numbers == "one" ? thumb : again; thumb and again will replace something else. Don't worry about them.

how do i say that if the numbers array is representing "one" then it replaces as "thumb", otherwise "again".

View 5 Replies View Related

Visual C++ :: Retrieve IP Information On Any Windows

Sep 23, 2012

I used to retrieve IP and NIC information by querying windows registry. Now I'm trying to use GetAdapterAddresses() API. Using GetAdapterAddresses() to get IP is not that easy, I need to dig a long deep as I check some examples so far, anyways my question is: Calling this API will return success on all versions of Windows ie: 32bits & 64bits ?

Though Microsoft has not opened any source, where this API is actually retrieving Windows IP information.?. Is it reading Registry or some windows file.

View 6 Replies View Related

Visual C++ :: Windows 64 Bit Or 32 Bit Preprocessor Directives?

Jul 1, 2013

I want to connect to an SQL Server database using ADO with VC++.

In order to do that you need to import an external dll, like so:

#import "C:Program Files (x86)Common FilesSystemadomsado15.dll"

What if the OS is not 64 bit? That would mean the (x86)-suffix would be incorrect.

how to work around this using certain preprocessor directives?

Something like this, maybe?:

#if 64bit
#import "C:Program Files (x86)Common FilesSystemadomsado15.dll"
#else
#import "C:Program FilesCommon FilesSystemadomsado15.dll"
#endif

View 9 Replies View Related

Visual C++ :: How To Tell If Windows Partition Is Active

Nov 24, 2014

My goal is to know if Windows is installed on an active disk partition.

View 8 Replies View Related

Visual C++ :: Windows Slideshow Screensaver

Apr 21, 2013

I am looking windows slideshow screen saver source code.

View 5 Replies View Related

Visual C++ :: MFC Child Windows Application

Nov 9, 2013

I am new in Visual C++ and I have to make an MFC application with "child" windows. Here is what i need to achieve - [URL] ..... As you can observe when you click on the cross of popup window or child window 2 both are closing.

View 2 Replies View Related

C++ :: Nested Conditional Operations

Feb 4, 2014

So I think I am having syntactical problem with my code.

Code:
int main() {
vector<int> ivec;
int score;
[Code] ....

I get an error from my compiler on the ?10th? line (Nested condition line) that says |19|error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'|

The purpose of the program is to take input and store it in a vector and then change the value to be between 1-6. I made this for the purpose of learning about nested conditional operations.

View 3 Replies View Related

C++ :: Getline As Conditional Of While Loop

Aug 1, 2014

I am trying to use getline as the conditional for a while loop as seen below.

string filename, guard_name;
int call_number;
vector <Seniority> SeniorityList;
ifstream SeniorityFile;

[Code] ....

However, when I compile the code, I get the following error message on the line with the while loop.

error C2780: 'std::basic_istream<_Elem,_Traits>
&std::getline(std::basic_istream<_Elem,_Traits>
&,std::basic_string<_Elem,_Traits,_Alloc>
&)' : expects 2 arguments - 3 provided

The program will be reading in a .csv file, so I need my program to be able to deal with values separated by commas. Is there a reason why it will not accept that conditional statement?

View 3 Replies View Related

C++ :: UDP Protocol In A Conditional Statement?

Nov 4, 2013

I'm facing a serious problem with udp protocol. I have Master & Slave devices.I did implement the class as the follow pseudo code states

In Master side

while (true)
{
1-send data to slave;
2-get data from slave;
3-apply force;
}

In Slave side

while(true)
{
1-get data from master;
2-if (collision happnes)
send force to the master
}

the problem is in line 2 in Master side. Once I include the line I can't send or receive data. What do you think the problem is?

View 3 Replies View Related

C# :: Valid To Use And / Or When Using Conditional Operator

Jan 31, 2014

I want to know if it's valid to use and/or when using the conditional operator.

Example:

value = textBox1.Text;
decimal? qty = (value.Equals("0") || value.Equals("0.0")) ? null : (decimal?)decimal.Parse(value);

View 2 Replies View Related

Visual C++ :: Rapidly Pasting From Clipboard Under Windows 7

Feb 3, 2013

I designed an app for work that lets you enter data in a much more efficient way, then it needs to paste this data into the very curmudgeonly interface we use for work. I designed this app a long time ago while at a different company, and I used VC++ 6. I'm still using VC++ 6, but in a vbox with windows XP.

The code is being called as part of a bigger function that determines what exactly needs to be pasted into the work app spreadsheet. I have to call each item separately because the work app does not take copied tabs the way Excel would or whatever, it just ignores them. And it also pops up boxes and such that need to be handled in other ways.

The result works just fine under Windows XP, but when I do it under my regular Win7 box or on the Win7 boxes at work, it does not work properly.

This sets the data up, Text being the data to be pasted:

Code:
while (1) {
if (OpenClipboard() == FALSE) {
::Sleep(1);
continue;
}
HGLOBAL clipbuffer;
char * buffer;
EmptyClipboard();

[Code] ....

No infinite loops yet, again was just testing if it was OpenClipboard failing because it was being called again too quickly or something (and it did happen occasionally).

Then testing that the clipboard data is correct (this is always true), and pasting with keybd_event. SendInput is not available with VC++ 6.

Code:
HGLOBAL hglb;
LPTSTR lptstr;
LPTSTR buf = Text.GetBuffer(0);
while (OpenClipboard() == FALSE)
::Sleep(1);

[Code] .....

If the ::Sleeps are commented out, it will paste the wrong data almost every time under win7. It seems like it pretty much uses the last thing to be copied in the function and pastes it over and over (but not *always*). If I uncomment them, it will work as expected, but it obviously takes longer. With ::Sleep(50), it works about 80-90% of the time. Obviously I can't have the wrong data being pasted, and I'd prefer not to have to wait like this--and perhaps on a slower system or a system that is doing other things it may take longer and paste the wrong thing. It works fine on XP even without the sleeps.

Did keybd_event become a separate thread or something? Am I doing something wrong with the buffers? (I've tried using CSharedFile too with GMEM_MOVEABLE | GMEM_SHARE | GMEM_ZEROINIT settings, exact same thing.) Why does it work fine under XP but not under 7?

View 10 Replies View Related

Visual C++ :: Error In Registering Windows Class

Jan 28, 2013

The following code it taken from msdn library but it is failing to compile.

the following code has a header where all the variables used here are stored in header App.h.

The following lines are giving trouble:

Code:
DialogBox(pApp->getInstance(), MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, pApp->About);
error: 'App::About': function call missing argument list; use '&App::About' to create a pointer to member

Code:
wcex.lpfnWndProc= &App::WndProc;
error: '=' : cannot convert from 'LRESULT (__stdcall App::* )(HWND,UINT,WPARAM,LPARAM)' to 'WNDPROC'

There is no context in which this conversion is possible

Here is the complete code:

#include "stdafx.h"
#include "App.h"
App::App(void) {
}
App::~App(void) {

[Code] .....

View 4 Replies View Related

Visual C++ :: Showing Console Windows In Win32 DLL?

Oct 31, 2014

Is it possible to show a console window in a Win32 DLL?

View 3 Replies View Related

Visual C++ :: Use Windows Sockets To Send Email?

Jan 26, 2013

I have struggled to send email from my MFC applications using severl methods:

1) http via my server - works but limited
2) M$ Outlook automation - works but not easily interchangeable between machines
3) Windows Sockets - available information simply too complicated
4) Purchase an ActiveX control - I hate black box solutions and am too cheap

I have looked at P. J. Naughter's class
CPJNSMTPConnection v2.99
An MFC class to encapsulate the SMTP protocol
[URL]

This approach requires the implementation of OpenSSL which turns out to be nothing short of a nightmare to install (so I never got it to run). I am looking for an example of an application that utilizes SMTP via Windows sockets api.

View 6 Replies View Related

Visual C++ :: Windows 7 Explorer Doesn't Get Refreshed

Aug 4, 2013

I have created an application to burn my data files into DVD. The problem which I am facing is as follows:

Suppose I have a folder "Doc_Files" present inside "D:Data" location for burning into DVD. The correct behaviour of the application is, after writing the "Doc_Files" folder into disc, I have to immediately delete this "Doc_Files" folder from the "D:Data" location.

I am calling the DeleteFile() Win32 API for deleting those files which are present inside "Doc_Files" folder.

The files are getting deleted successfully but they are still shown in the same folder untill I do not terminate the application.

Till the application is up those files are still visible even after they are deleted. And as soon as I kill my application and refresh my data folder those files are gone, and the folder becomes empty.

I am making use of IMAPI interfaces and methods for burning process.

View 3 Replies View Related

Visual C++ :: Reading / Writing Registry In Windows 7?

Feb 19, 2013

I have a 32-bit application that I've been maintaining for about 12 years and it runs on every Windows platform up to Windows 7. In all that time I've been using CWinApp::GetProfileXxxx() and CWinApp::WriteProfileXxxx() calls to read and write my program settings (about 70 settings) in the Registry. The settings are read from the Registry at start-up and written to the Registry when the program closes. There is also a method for the user to read and write the program settings to an INI file using the same code as the Registry access.

On my Windows 7 system the Registry read/write works just like it always has on all previous Windows versions. However, on some customer's Windows 7 machines there appears to be a problem with the Registry access. The program settings are either not being read from the Registry or are not being written to the Registry. I think the settings are not being written - but I don't know that. When the user uses the INI file the settings appear to be read and written.

The customer has complained a bit (I'd complain too) but doesn't have the time or doesn't want to take the time to run some simple tests for me to find out what's going on with his Windows 7 system.

So here is my question: Are there any user account settings or permissions that can block the program's access to the Registry? He claims he is an Administrator but I can't even get him to verify that.

View 5 Replies View Related

Visual C++ :: Writing To HKLM Registry In Windows 7?

Jul 8, 2013

When I write to the Windows 7 Registry at HKEY_LOCAL_MACHINE, I get a return code of 5 which is the "access denied" message when I execute RegCreateKeyEx.

This happens even if the User has administrator rights.

How can I tell Windows 7 to allow the program to write to the registry?

The application is a 32-bit application and it should be allowed to run in either a Windows 7 32-bit or 64-bit machine.

I noticed that when I run certain popular programs, a User Account Control dialog box comes asking:

"Do if you want to allow the following program from an unknown publisher to make changes to this computer".

Should my application call User Account Control and if so, how do I do it in C++ Visual Studio 2008?

I also found out that 64-bit Windows machines have two registry hives. Is there a different code to handle the same task?

View 8 Replies View Related

Visual C++ :: Getting Exceptions On Windows 7 And 8 On Different Parts Of Code?

Feb 25, 2015

I'm Getting exceptions on Windows 7 and Windows 8 on different parts of the Code? Why this can be happening, why the difference in behavior?

View 6 Replies View Related







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