Visual C++ :: Mq4 Platform Calling Functions From DLL

Feb 10, 2013

I have Mq4 platform calling functions from DLL some how it doesnt make any differents when I make the call....

// DLL Code

#define WIN32_LEAN_AND_MEAN
#define MT4_EXPFUNC __declspec(dllexport)
using namespace std;
std::string My_String;
#define stringify(mymonths ) # mymonths

[Code] ....

I call this function

bool counts = StartRulls(bars);
Print("counts =",counts );
2013.02.09 23:03:242010.03.31 16:37 My_Mq4.mq4 EURCAD,M5: counts = 1

My result always stays 1

View 4 Replies


ADVERTISEMENT

Visual C++ :: Cross Platform GUI Development

Aug 28, 2013

I am planning to develop a GUI that will run on Windows, Linux, Android & iOS. If am right, VC++ apps don't work on Linux, Android & iOS. Is that correct?

Is there an alternative to that? Which other tool works for GUI development on above mentioned 4 platforms?

View 2 Replies View Related

Visual C++ :: Unresolved External Symbol When Building For X64 Platform

Jul 11, 2014

The project builds on Win32 platform, but not on x64.

Full error message: dllentry.obj : error LNK2001: unresolved external symbol "class CFactoryTemplate * g_Templates" (?g_Templates@@3PAVCFactoryTemplate@@A)

The dllentry.cpp (a DirectShow base class) compiles on both platforms. It contains the external declarations:

extern CFactoryTemplate g_Templates[];
extern int g_cTemplates;
g_Templates[] is then used in two functions:
__control_entrypoint(DllExport) STDAPI DllGetClassObject(__in REFCLSID rClsID,
__in REFIID riid, __deref_out void **pv)

[Code]...

myClass.cpp contains the definitions for the two externals in dllentry.cpp, at top level, just after the includes:

CFactoryTemplate* g_Templates=0;
int g_cTemplates=0;

myClass.cpp also compiles by itself, but the project does not build. I checked all the libraries in the project settings and all seems to be OK, the 64 bit versions are used.

What should I do to make the project build for x64 platform?

View 4 Replies View Related

Visual C++ :: Cross Platform Program - Make A Note Of Value Of PA

Nov 4, 2013

I'm working on a project which uses gtk+ and gtkmm. We use them in preference to MFC because the program needs to be cross-platform. For quite a long time, customers on OS-X and Linux have sometimes complained that the program would crash during shutdown but the Windows version (which I work on) never seemed to suffer. However, I'm now transferring my build environment to a new PC and I'm noticing the same shutdown crashes. It's a bit complicated so let me start with a small example:-

Code:
namespace Whatever {
class B {
public:
virtual ~B();
private:
int bb;

[Code] ....

Suppose I run the above program. When it stops at breakpoint #1 I make a note of the value of pA. Eventually the program reaches breakpoints #2 and #3. At each point my this pointer is exactly the same number. If the value of pA was 0x03604fb0, my this pointer is identical at both stages.

Now let's consider the real example:-

Code:
namespace Gtk {
class Widget {
public:
virtual ~Widget() {}

[Code] .....

Suppose I run the real example. At breakpoint #1 the value of pW is 0x03604fb0. But by the time I reach breakpoint #2 my this point is slightly different:- 0x03604fcc. It doesn't seem right to me and I'm wondering if it might be contributing to our shutdown crashes.

View 6 Replies View Related

Visual C++ :: How To Determine Cross Platform Type During File Save

Nov 10, 2014

I am overriding OnSaveDocument in my MFC document class to strip out the carriage returns when saving my app's document to a UNIX file system but not when the user is saving a file to a Windows file system.

Is there a way to determine if the lpszPathName in OnSaveDocument(LPCTSTR lpszPathName) is a UNIX or Windows file system?

Note, I want to avoid hard coding server names and I want to avoid overriding the FileSave dialog and forcing the user to select Windows or UNIX.

View 6 Replies View Related

C++ :: Calling Template Functions

Feb 21, 2013

How do I call these functions from Mechanical.h???

Mechanical.h
#ifndef MECHANICAL_H_
#define MECHANICAL_H_
class statics { public:

template<class T> struct Inertia_types {
T Rec(T _x, T _y);
T Tri(T _x, T _y);

[Code] ...

I am trying to create templated functions which I can apply all data types to except for strings and other types such as wchar. Am I also writing these correctly? This is my first attempt ever doing this.

View 1 Replies View Related

C++ :: Calling Functions Of Class And Outside With Same Name?

Apr 6, 2013

Just a few moments ago i was just doing foolish things in c++ and discovered something new. Though some of you might have known this, for those who dont know, take a look at the follwing 2 small programs,

#include <iostream.h>
#include <conio.h>
void main();
void loop()

[Code]....

so here is my problem. i think u wud have figured out what m trying to do above. am actually calling the main() of the class and from there, i want to call the usual main... the problem is, during A.main()'s run, if i refer to main(); , that call represents itself, that it, it is like it calls itself. How on earth can i call the outside main?

View 7 Replies View Related

C++ :: Calling Functions From Templates?

Mar 14, 2013

Having issues calling my arguments from my templates, when i declare x and n in the main it comes up with errors

code below:

#include <iostream>
#include <cmath>
#include <cstring>
#include <string>
#include <string.h>
using namespace std;
int intInput1, intInput2;

[code].....

View 4 Replies View Related

C :: Writing Factorials And Calling Other Functions To Do So

Jul 6, 2013

I am trying to get this statistical equation to work. m! / n! (m-n)!.

Code:
#include <stdio.h>
long factorial_M(long); // function prototype //
long factorial_N(long);
long total (long);
int main(int argc, const char * argv[]) {

[Code] .....

View 13 Replies View Related

C++ :: Calling Functions - Vector Of Pointers

Mar 27, 2013

I have a vector of pointers inside a seperate Exam class.

vector <Question* > question_list

The Question class is my base class in which I have derived sub classes for the different types of questions (MultipleChoice, LongAnswer, etc.). I am using my vector to hold the different types of questions.

in each of those classes I have virtual "write" functions in both the base and the derived classes, that write to a file differing for each type of question.

My problem now is calling the write function from a Exam function. I've tried several methods, such as:

for (size_t i = 0; i < question_list.size(); i++) {
question_list[i].write(testfile.c_str());
}

but it comes with two errors: "error C2228:left of '.write' must have class/struct/union" along with "IntelliSense: expression must have class type"

I have made a write function for the exam class as well but am not sure what it should include since the Exam class is not a derived class of the Question class.

View 15 Replies View Related

C++ :: Create Two Threads Calling Even And Odd Functions

Mar 1, 2013

I want to create two threads which will be calling even and odd functions where even function should print even number and odd function should print odd number.Can it be possible with condition variable? What is the code in both the cases i.e. two separate function and with condition variable.

View 6 Replies View Related

C++ :: Sinking Fund And Calling Functions

Nov 17, 2014

I have to do this assignment but really don't understand the calling and called functions yet. Rewrite your program for computing the value of a sinking fund so that there is a C++ function that is called to calculate the value, i.e., a function that returns the accumulated value based on the number of years with the annual interest rate compounded monthly and a fixed-size monthly deposit.

My program is:

#include <iostream>
#include <cmath>
using namespace std;
int main() {
double R, r, t;

[code].....

View 1 Replies View Related

C++ :: Calling Functions From Text Files?

Jan 5, 2015

I'm working on a code that reads a text file and follows the instructions written in that file. An example of the text file:

*sum
11 4 61 2
1 2 0 14
17 99 1 1
*subtract
5 6 7
1 1 1
45 6 9

I want to read the text file line by line, each time I find an instruction (that is, the keywords *sum or *subtract) I want to make a summation (in the case of *sum) of all the numbers in each of the following lines, and repeat until the next instruction appear. So the text file above should generate:

78
17
118
-8
-1
30

That is:

11 + 4 + 61 + 2 = 78
1 + 2 + 0 + 14 = 17
17 + 99 + 1 + 1 = 118
5 - 6 - 7 = -8
1 - 1 - 1 = -1
45 - 6 - 9 = 30

how can I implement a dictionary(I'm guessing a dictionary is the best way to go here) so that when I read the string *sum i can call a function that does the summation of the following lines.

the size of the text file may be big (several mb) and the number of different instructions to search for may be in the magnitude of hundreds.

View 5 Replies View Related

C/C++ :: Calling Functions Inside A Class?

Nov 4, 2014

Im currently working on a class assignment and the pseudo code containing the instructions that I need to complete list:

//--------------------------------------------------------------------------------------------------------------
// CTOR: Point()
//
// DESCRIPTION
// Default constructor. Initializes the point to be at the origin (0, 0) and the color to black = (0, 0, 0).
//
// PSEUDOCODE
// Call Init() and pass 0, 0, 0, 0, and 0 as the parameters.
//--------------------------------------------------------------------------------------------------------------

My code for this is:

Point::Point(){
void Init(0, 0, 0, 0, 0);
}

The code I wrote for the function Init is here:

Point::Init(int mX, int mY, color mColor){
mX = 0;
mY = 0;
mColor = pInitColor;
}

My problem here is that whenever I try calling this function in the point class, I get an error next to void Init saying incomplete type is not allowed. Also visual studio is telling me that it expects a ')' after my first zero in that line.

View 1 Replies View Related

C :: Calling Functions From Parallel (MPI) Fortran Program

Apr 24, 2013

I'm working on a parallel Fortran program by using MPI, which calls a very good random number generator function from C (drand48 and srand48 for seed).

My Fortran program file "Par_PICFort_4.f95" is smt. like:

Code: PROGRAM main
IMPLICIT NONE
Include 'mpif.h'

[Code]....

I compile the code as: Code: mpif77 -o PIC Par_PICFort_4.f95 drand48.c Program seem to be running, but after checking the simulation results, I see that drand48 is not working in a parallel way. Creating independent random numbers which different seeds is very important for me.

Question: Is it possible to run the drand48.c file as parallel?

View 2 Replies View Related

C :: Calling Functions With Arguments Using Pointer Variables As Operators

Feb 2, 2013

There are, or course, better ways to do this, but I need to stick to some rules:

(1) Use only pointer variables and not arrays or structs.
(2) Use the three functions shown--regardless of easier methods.

The program should ask for some input, operate on those numbers, and then display the results. I know I am confused over these things:

(1) All that syntax using '*' and '&' or neither.
(2) How to use the char type correctly.
(3) How to use a char type input as an operator (a + b).
(4) How to use the pointer of the operator variable (+,-,*,/) in an actual equation.

Code:
#include <stdio.h>
#include <stdlib.h>
// *** Prototype Functions ***
void Post_Results (float*);
void Calculate (float*, float*, char*, float*);
void Get_Numbers (float*, char*, float*);

[Code]......

View 5 Replies View Related

C++ :: Program To Calculate Company Weekly Payroll - Calling Functions?

Jun 9, 2014

This program in not completed. I am creating a large program in order to calculate a company's weekly payroll. For now I am filling in the separate functions piece by piece before the rest of the program is completed.

Right now I am trying to use separate functions to call other functions. I need to ask the user for the file name and then open the file. I am no longer getting any compiler errors however when I run the program all it displays is "Welcome."

So it's not actually calling the NameTheFile function and the OpenTheFile function. It just says "Welcome" and then closes down. Why is it doing this?

/*Program to determine company's weekly payroll*/

#include <iostream>
#include <string>
#include <fstream>
using namespace std;
void NametheFile() {

ifstream inputFile;

[Code] ....

View 1 Replies View Related

C++ :: Calling Derived Class Functions In A Function With Parameter Of Base Class

Mar 30, 2013

Say I have 3 classes:

class Player {
public:
virtual func1();

[code]....

Say in my main class, I have a function fight(Player p1, Player p2) and I would like to do something like this in the fight function, given that p1 is the human and p2 is the computer:

//function fight()
fight(Player p1, Player p2) {
p1.func2();
}
//using function fight()
fight(human, computer);

When I compile the program, I got this: error: ‘class Player’ has no member named 'func2()' What can I do to allow p1 to call func2 inside fight()? I'm not allowed to use pointers as the parameter for fight() and have to use the signature fight(Player p1, Player p2).

View 6 Replies View Related

Visual C++ :: Calling A Function In AfxBeginThread?

Oct 1, 2014

I have the code:

void go(CMFCApplication1Dlg * pdlg)
{
pdlg->listcontrol1.InsertItem(0, "Row1");
}

then i call it in thread

Code:
void CMFCApplication1Dlg::OnBnClickedButton3()
{
AfxBeginThread(go(this), NULL, THREAD_PRIORITY_NORMAL, 0, 0, NULL);
}

It doesn't work.

View 13 Replies View Related

Visual C++ :: Calling Routines From Fortran 77 Using Win32 DLL

Aug 14, 2014

Is it possible to call VC++ routines using a Win32 DLL form fortran 77??

View 3 Replies View Related

Visual C++ :: Calling Self-contained Posix Thread?

Mar 2, 2015

pThread turns out to be NULL here. Wondering what the correct way is...

Code:
class CPF_Thread {
public:
unsigned int threadID;
Coordinater coordinater;
virtual UINT proc() {

[Code] .....

View 2 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++ :: Being Argument Array Not Copied When Calling Function

Feb 7, 2013

The code below outputs this:
a[]= 00
a[]= 10
a[]= 10
a[]= 10
a[]= 11
a[]= 11
0.

But I was expecting this:
a[]= 00
a[]= 10
a[]= 10
a[]= 00
a[]= 01
0.

This describes how the process is running in machine:
1. Defining a[2]{0,0}; ii=0; aj=0
2. Calling function func(a,ii,aj) |func({0,0},0,0)|
3. func({0,0},0,0) defining w=0; static aa=0
4. func({0,0},0,0) if(0) returns aa=1
5. func({0,0},0,0) for j=0
6. func({0,0},0,0) for Outputing "00", because a[2]={0,0}, look (1).
7. func({0,0},0,0) for if(!0) | because a[0]=0| returns w+=func(a,ii+1,j) |func({0,0},0+1,0)| and calls func({0,0},1,0)
8. func({0,0},0,0) for if func({0,0},1,0) defining w=0
9. func({0,0},0,0) for if func({1,0},1,0) if(1) returns a[0]=1, because of static aa=1, см 4.
10. func({0,0},0,0) for if func({1,0},1,0) for j=0
11. func({0,0},0,0) for if func({1,0},1,0) for Outputing "10", because of a[2]={1,0}, look row #9
12. func({0,0},0,0) for if func({1,0},1,0) for if(!1) |because a[0]=1|
13. func({0,0},0,0) for if func({1,0},1,0) for j=1
14. func({0,0},0,0) for if func({1,0},1,0) for Outputing "10"
15. func({0,0},0,0) for if func({1,0},1,0) for if(!0) |because a[1]=0|
16. func({0,0},0,0) for if func({1,0},1,0) for if if(1==1) |because ii=1, func({0,0},ii,0)|
17. func({0,0},0,0) for if func({1,0},1,0) for if if return 0
18. func({0,0},0,0) for if w=0 |because func({1,0},1,0) gives 0|
19. func({0,0},0,0) for j=1

And from now, something is happening that I cannot understand:
20. func({0,0},0,0) for Outputing "10"

Why so? If func has itselfs local variables, including a[2]={0,0}.

I was expecting this:
20. func({0,0},0,0) for Outputing "00"

So a[2] array is not local variable. Why it happens?

Code:
#include <iostream>
using namespace std;
int func(bool a[],int ii,int aj) {
int w=0;
static bool aa=0;

[Code] ....

View 3 Replies View Related

Visual C++ :: Calling ATL COM DLL Method (that Opens A Dialog) From Browser?

Oct 11, 2013

I have a COM Object created using ATL (without MFC Support)

The Object has 1 method that opens a Dialog (that does all the rest) and when finish - returns 2 values back (1 is enough)

Currently I call it from another EXE:

hr = CoCreateInstance(
CLSID_MyControl,
NULL,
CLSCTX_INPROC_SERVER,
IID_IMyControl,
(void**) &pMyControl
);

and then:

hr = pMyControl->MyMethod (ATL::CComBSTR(InputString1), ATL::CComBSTR(InputString2), &IntReturned, &IntReturned);

Is it possible to call it as is from a browser ?

How can I Instantiate the object and invoke my method (with params) from the browser ?

will it open the dialog ?

View 3 Replies View Related

Visual C++ :: Calling Default In OnNcPaint Before Painting Override Caption?

Jun 20, 2013

I'm overriding OnNcPaint to do my own caption painting (in a dialog box). If I call "Default" before I do my painting, the default caption and borders remain (as if I'm not painting at all). If I comment out my call to "Default", my caption looks great, but I get no menu bar (I have a menu on the dialog). If I call "DrawMenu" before or after painting, the dialog is all screwed up (and there is no painting in the nonclient area).

I'm running VS2012, on Windows 7.

View 10 Replies View Related

Visual C++ :: Window Created By Calling Create - DestroyWindow Function?

Jan 17, 2013

If a window is created by calling Create, the function DestroyWindow must be called to destroyed it at the end?

View 4 Replies View Related







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