Visual C++ :: Switch From TXT To RTF During Runtime

May 2, 2015

While running a Doc/View SDI, is there any way to switch from text mode to rtf mode during runtime? Search reveals nothing.

Say I have an editor and I want the app to use text, I can set the ctor as follows.

Code:

CEditorDoc::CEditorDoc() {
// TODO: add one-time construction code here
m_bRTF = FALSE;
}

But once I've done that and compiled the app, while it's running, is there a way for the user (or programmer) to change the mode back to RTF? One solution that occurred to me is to use 2 document classes, but that's a hassle.

View 8 Replies


ADVERTISEMENT

Visual C++ :: Adding Header And Lib Files At Runtime?

Feb 4, 2013

I was created a dynamic library (Used win32 App) & compiled with no error.

Then i was created my main application (MFC) & paste the .h,.lib,.dll files from the source path(dll App Path) to destination path(Main App Path). If i used the below command in my app means the project working good.

Code:
#include "Alg.h"
#Progma Command(lib, "VTAlg.lib")
& also paste the VTAlg.dll in my app path.

here Alg.h contains the some methods , In future i will edit the function like below for my client requirement but no function name & Arguments change. The changes made in inside function(Logically changed) only.

My client contains only .exe file + .dll file.

My requirement, So after change the method i will send only .dll file to my client

If i change my lib file name VTAlg2.lib instead of VTAlg1.lib (But Same Function name & Arg type)means how can i edit the code below

Code:
#include "Alg.h"
#Progma Command(lib, "VTAlg.lib")

& How to run my application at client place.

View 14 Replies View Related

Visual C++ :: Calling Function From OnDraw - Runtime Assertion

Feb 2, 2014

Following function is causing run-time assertion. I am using VC6.0 professional version. My OS is Win7.0. I am calling the function from OnDraw. OnDraw does not contain any other code other than the function call code:

Code:
void CMoireUseCirclesView::UseCircle(CDC* pDC){
int x1, y1, x2, y2;
x1=20;
y1=100;
x2=200;
y2=280;
int color1=0;
int color2=0;

[Code] ....

The assertion is occurring at:

Code:
newPen.CreatePen(PS_SOLID,5, RGB(color1,color2,color3+i));

The error message is:

Debug Assertion Failed
Prog:....
File:wingdi.cpp
Line:1120

Debug is giving following values

Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:WindowsSysWOW64kernel32.dll', no matching symbolic information found.
Loaded 'C:WindowsSysWOW64KernelBase.dll', no matching symbolic information found.
Loaded symbols for 'C:WindowsSysWOW64MFC42D.DLL'

[Code] ...

View 7 Replies View Related

Visual C++ :: How To Change Client Area Icon During Runtime

Feb 23, 2015

how to change the mouse tracking icon during runtime. I wish to emulate the Microsoft Paint app behavior with respect, for example, to click on a toolbar button such as the 'Fill With Color' bucket and have the mouse pointer icon change to a little bucket. I wish to do this in an MFC SDI app.

Here's a bit of code that does nothing that I can tell, although it compiles and runs. (m_hIcon2 is a member HANDLE, IDI_FLOODFILL is an existing icon in the app resources). I have come across numerous other examples that do not work and/or will not compile using VS 2010 Win7(64).

Code:
void CMainFrame::SetNewIcon() {
m_hIcon2 = LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_FLOODFILL));
SetIcon(m_hIcon2, FALSE);

[Code].....

View 8 Replies View Related

Visual C++ :: List DLL Library Functions Signature At Runtime

Dec 31, 2012

I want to know how to list the all the symbols in the shared library(dll or .so file). I dont want commands like nm or objdump or depends.exe . I want to get the list of functions available in shared library programmatically at runtime (after calling loadlibrary/dlopen and GetProcAddress/dlsym). Is there a way to get the complete signature of functions in a shared library?

View 2 Replies View Related

Visual C++ :: Using Fstream To Open A File Created Only During Runtime?

Nov 20, 2012

I'm using Visual C++ 6.0 and I'm trying to use fstream to open and read a file that is created only during runtime. This file is written by another function running on another thread, and my program will keep trying to "open" the file until it can be opened, i.e. after it's created, then read 3 numbers from it and execute the rest of its code.

The file test.txt has the content

Code:
1
3
4

My program that polls and opens the file is as follows:

Code:
ifstream fin;
std::string tfile, snum1, snum2, snum3;
long int num2, num3;
tfile.assign(argv[1]);
printf("Begin prog %s
", tfile.c_str());

[code]....

I executed the program by

Code: test_prog.exe "C: est.txt"

and waited about 3 seconds before putting the test.txt file into C:

My output was

Code:
Begin prog C: est.txt
Cannot open file C: est.txt
Cannot open file C: est.txt
Cannot open file C: est.txt
Cannot open file C: est.txt
Cannot open file C: est.txt
Cannot open file C: est.txt
fin is open
snum1 =
num2 = 0 num3 = 0
End of prog

The test.txt file disappears after I refresh the C: folder.

So the values for snum1, num2 and num3 are all wrong, as if the file was not read correctly.

If I put a while fin.good() loop after printf("fin is open "); for that entire block (until printing the values of num2 and num3), then I get

Code:
Begin prog C: est.txt
Cannot open file C: est.txt
Cannot open file C: est.txt
Cannot open file C: est.txt
Cannot open file C: est.txt
Cannot open file C: est.txt
Cannot open file C: est.txt
fin is open
End of prog

How can I correctly read a file that is only created during runtime?

View 4 Replies View Related

Visual C++ :: Runtime Check Failure - Variable Used Without Being Initialized

Nov 10, 2014

Under visual studio, this is a typical run time error,

Code:
void func(int x){
x = 3;
}
int main() {
int x;
func(x);
}

When x is passed to the function func, it is not initialized. But my question is that why it should be an error? On the other hand, if I change the definition of func a little bit like this,

Code:
void func(int& x) {
*x = 3;
}
int main() {
int x;
func(&x);
}

Now in main, x is still not initialized, but this time there isn't a run time error like "the variable is being used without being initialized. Why?

View 5 Replies View Related

Visual C++ :: Runtime Check Failure - Value Of ESP Error With Conversions

Dec 2, 2014

I get this error:

run-time check failure #0 - the value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention

when i try to run my code. It has compiled fine on another computer, but it simply will not work on this one. This is the part of code where it is receiving the error. it has to do with the stoi

Code:
#include <string> // for use of string
#include <fstream> //for file handling
#include <iostream> // for file handling
#include <cstdlib>
#include <iomanip> //for the setprecision used further below
using namespace std;
struct MasterData //struct created named 'MasterData' to hold one line from master file

[Code] .....

View 2 Replies View Related

Visual C++ :: Runtime Error In Merge Sort Algorithm

May 3, 2013

# include <iostream>
# include <vector>
# include <cstdio>
# include <algorithm>
# define inf 100000

using namespace std;
int cnt;
vector<int> merge( vector<int>& left, vector<int>& right) {

[Code] ....

View 6 Replies View Related

Visual C++ :: Game Controlled At Runtime By External Source File

Mar 24, 2013

Is it possible to create a program like Robocode, a game controlled at runtime by an external source file in visual c ++? For example create a checkers game where there would be an external source file, read at runtime, which would play automatically, with artificial intelligence. You can? If yes, how?

View 9 Replies View Related

Visual C++ :: Using If Or Switch With LPCWSTR?

Oct 9, 2013

i am trying to read an ini file and usse an if or switch to take action.

i have this in ini.h file

LPCWSTR ini_read_string(LPCWSTR _ini_File_Name, LPCWSTR _ini_Section_Name, LPCWSTR _ini_Key_Name, LPCWSTR _ini_Default )
{
TCHAR _Rvalue[5];
GetPrivateProfileStringW(_ini_Section_Name,_ini_Key_Name,_ini_Default,_Rvalue,5,_ini_File_Name);
return (LPCWSTR) _Rvalue;
}

now when i do this:

OverLay[0]=ini_read_string(map_file_ini,_T("Section"),_T("Key"),_T("NULL"));
if(OverLay[0]==_T("NULL"))MessageBox(NULL,_T("File or kay not exists"),_T("Error"),MB_ICONEXCLAMATION|MB_OK);

but the key dos not exists, so it will return NULL, but yet i am not getting the message box (LPCWSTR) i also dit try

if(OverLay[0]=="NULL"), if(OverLay[0]==L"NULL"),if(OverLay[0]== (LPCWSTR)"NULL"), if(OverLay[0]== (LPCWSTR)L"NULL"), if(OverLay[0]== (LPCWSTR)_T("NULL"))

but it never dit work.to be sure of the returning value i also dit this

MessageBox(NULL,ini_read_string(map_file_ini,_T("Section"),_T("kay"),_T("NULL")),(LPCWSTR)L"Error!",MB_ICONEXCLAMATION|MB_OK);

and ther it is, an message box with the text "NULL" so why is the if(OverLay[0]==xxx) not working? and i also need a big list so an working switch(OverLay[0]) will be nice as well (else i need to do if/ else if many times)

View 14 Replies View Related

Visual C++ :: File Processing Within A Switch?

Nov 17, 2014

The error ive been getting with this code is after i go to the check out option, enter the data then click (ctrl + z). Then program glitches back and forth from the menu to the check out option continuously and im not entirely sure why.

Heres my code:

Code:
#include <iostream>
#include <windows.h>
#include <iomanip>
#include <fstream>
using namespace std;
void checkOut(){
cout << setw(10) << "Ministry of Health Hospital System

[code]....

View 7 Replies View Related

Visual C++ :: MDI Switch Between Tabbed And Cascaded Views

Jan 16, 2014

Essentially I have an MDI that I want to be able to switch between having all my views tabbed when one is maximized and having all my views cascaded or tiled to their previous sizes. The MFC app wizard provides options for either tabbed or untabbed views.

How to implement this? What is the class that MFC uses to place each of the MDI child frames in tabs?

View 1 Replies View Related

C :: Use Switch Case As A Menu To Switch Between Patients

Dec 30, 2014

I am trying to make a program which manages the data of 5 different patients (its an uni assignment), and i want to use a switch case as a menu to switch between the patients. All other functions (as for example putting the infromation on a file) work, but i cant figure out to bring the switch to work. First it asks for the number of the patient which should be worked with, this works perfectly, but afterwards changiung between the persons doesnt work as thought. It should ask everytime after it switches to one patient (i removed some functions to make it easier to read) and then asks to which it should jump next. If i put the number of one case (lets say 3) it just stops the program.

********Example:
user@pc ~/wherever $ ./program
current variables:
jo = 2
a = 0
1 //the entered number
The variable a = 1
patient 1
Enter the number of the next patient2
// and then it closes
**************

The same thing happens if i compile an example code from a book, it writes the first case and then stops.

I looked already through the forum but didnt find a person with a similar problem, maybe i didnt dig deep enough.

I am running Linux Mint 17 and use gcc as compiler.

Code:

include <stdio.h>
#include <stdlib.h>
int a=0;
int jo=2;
int main(void){
printf("current variables:
jo = %d
a = %d

[Code]...

View 13 Replies View Related

C++ :: Why It Is Runtime Polymorphism

Apr 4, 2013

class Base
{
.....
.....
.....
virtual void display();

[code]....

in the above polymorphism why is it called runtime polymorphism when i can say seeing the code itself that display() function in derived gets executed with ptr->display(),so how does it become runtime polymorphism when i could get decide at compile itself ???

View 6 Replies View Related

C++ :: Runtime Stack Overflow

Jun 5, 2013

Here is my error message: Warning1warning C4717: 'getx' : recursive on all control paths, function will cause runtime stack overflow

and here is my code I will Bold the part that is giving me problems!

class point
{
public:
point();

[Code]....

View 5 Replies View Related

C++ :: Declaring Array At Runtime?

Oct 21, 2012

I can not set the size of my array while running porgrama. Is there any way to do this in C + +?

---- code ------

#include <iostream>
#include <string>
using namespace std;

[Code].....

View 5 Replies View Related

C++ :: Processing Buttons Created At Runtime

Oct 7, 2014

I am developing a small game using MFC in which the game options like new game, save, open, exit etc. can be selected from the menu as well as from the buttons inside the window. I have no problems with the menu but the buttons do not seem to work at all.

The buttons are created at runtime using CButton class. To associate the buttons with the corresponding functions, I just used the same resource ID for the buttons as the menu options, but that did not work. When I click on the buttons, nothing happens. If I assign different resource IDs to the buttons, how do I handle the message map entries? Do I have to write different message map entries for the menus and the buttons while their function is exactly the same?

View 6 Replies View Related

C++ :: Oracle Library Runtime Error

Jan 14, 2014

I downloaded Oracle instantclient-basic-nt-12.1.0.1.0.zip and instantclient-sdk-nt-12.1.0.1.0.zip and extracted both to c:oracle I then went into visual studio 2013 and created a Win32 Console application with all default parms.

I then went into project -> properties -> C/C++ -> General -> Additional Include Directories and added my include path C:oraclesdkinclude

I then went into project -> properties -> Linker -> General -> Additional Library Directories and added C:oraclesdklibmsvcvc11

I then went into project -> properties -> Linker -> Input -> Additional Dependancies and added oraocci12.lib

The program compiles but when I debug i get a RUNTIME error that says "The program can't start because oraocci12.dll is missing from your computer. Try reinstalling the program to fix this problem. But I know the file exists in C:oraclesdklibmsvcvc11oraocci12.lib

This is the code if it makes a difference

Code:
#include "stdafx.h"
#include <iostream>
#include <occi.h>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])

[Code].....

View 8 Replies View Related

C++ :: Manipulate Image File At Runtime

Oct 20, 2013

I've come to a point where I want to manipulate an image file at run time or with pre-determine sizes and have to be applied when the windows is moved or through in program options.

I know I can do the applying part. However I am a little unsure of how to tackle the image manipulation. I want to make it so that it is not os dependant. So I know I can not rely on any os functions. The only other thought that came to mind was to deal with the video card itself.

So the main question after all of that is said and done. How is c++ able to interact with the video card directly for images? Or if there are existing function I can use. How do they do that? If I can use existing function I would like to be able to manipulate it myself.

View 4 Replies View Related

C++ :: TicTacToe With Classes - Getting Runtime Errors

Feb 17, 2013

I have this TicTacToe program that needs finishing. All the code is finished, but I'm getting runtime errors. It is printing out junk values from my array when they should be empty.

//Player.h
#include <string>
#include "TTT.h"
using namespace std;
class Player {

[Code] .....

//This is a screenshot of the output. [URL] .....

View 5 Replies View Related

C++ :: Program Ignores If / Else Statements On Runtime

Dec 4, 2013

Need fixing code to calculate male and female body fat percentages. Should a switch structure be used? Here is what I got:

#include <iostream>
#include <cmath>
#include <iomanip>
#include <string>
using namespace std;

int main() {
int bodyWeight;
double bodyFatPercent,bodyFat;

[Code] .....

View 15 Replies View Related

C++ :: Runtime Error In Hash Table

Apr 25, 2013

I am getting a strange runtime error when trying to run my hash table program. I have it separated in 3 separate files. I believe I have narrowed down where the error is occurring. It is either happening in insert(const &string s) or in the implementation of vector<list<string>> ht. I would appreciate some input. This is the implementation of insert():

void HTable::insert(const string &s) {
int h = hash(s);
cout<<h<<endl;
list<string> &tempList = ht[h];

[Code] .....

And it is giving me some sort of compilation error saying I cannot convert a type string to type list.

View 1 Replies View Related

C++ :: How Do Games Change Meshes At Runtime

Jun 25, 2014

Right, I'm making a game and I'm not sure how I'm going to do this:

On Skyrim (for example; there are thousands of others), when you equip a helmet, it appears on your character's mesh.

How do they do that? Do they modify the mesh, or simply render the helmet at a location which makes it look like it is on their head, or what?

View 2 Replies View Related

C# :: User Writing A Method During Runtime

Mar 23, 2014

I'm doing a project. And I want to give the user the ability to write methods just like you would regularly in c# during runtime and then use them during runtime. Is such thing even possible? If so how?!

View 12 Replies View Related

C/C++ :: Winform - Button Does Not Show At Runtime

Jun 18, 2014

I made a winForm with a button on it in the Designer (VS 2010 C++).

But when I run my app, the button does not show on the form.

The button visible property is set to true.

View 8 Replies View Related







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