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


ADVERTISEMENT

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

Visual C++ :: Replacing GUI In Win32 Application?

May 15, 2014

I have a Win32 C++ application which works pretty well, but I don't like the GUI and I want to replace it with one designed graphically, a la Windows Forms. What is the best strategy to port my code? I tried creating a new Windows Forms C++ application and got pretty far with it, but was stymied when trying to call my unmanaged functions on a button press. If I can't use Forms to add a GUI without completely rewriting the program, what's my best bet?

View 14 Replies View Related

Visual C++ :: How To Debug Win32 Message Loop

Sep 28, 2014

You place a breakpoint at one of locations within the message loop. But I want the breakpoint to trigger when I click on the application window, for example. But I can't, it went so fast so long as I switch from VS to the application program, the breakpoint is hitted again, then the application is frozen again. I don't know how to setup a conditional breakpoint.

View 3 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++ :: How To Call A Dialog From Win32 Resource DLL

Jan 16, 2013

How can I call a dialog , which is present in a seperate Win32 resource DLL .

View 4 Replies View Related

Visual C++ :: How To Get Same Info As Win32 PortConnector From DeviceIoControl

Mar 21, 2013

I can tons of information by calling DeviceIoControl (such as device ID, device description, whether it's connected or not) since I couldn't do it all with WMI. But I haven't figured out how to get from DeviceIoControl the info that a call to WMI's Win32_PortConnector gets. Are there any calls, directly to DeviceIoControl or something else that for a given device ID or device description would get the PortConnector information?

I would have used a combination of Win32_PortConnector and DeviceIoControl calls but the trouble with PortConnector is that it doesn't provide any information that would allow one to figure out which device ID it belongs to. Why do I need to do this? Because I'd like to get a combination of all the information the two methods provide for a given device such as a USB port, and all I'm getting from Win32_PortConnector is these scant few fields with no other clue:

string Caption;
string ConnectorPinout;
uint16 ConnectorType[];
string CreationClassName;
string Description;
string ExternalReferenceDesignator;
datetime InstallDate;

[Code] ....

View 1 Replies View Related

Visual C++ :: Create Window Form Function Using MFC Or Win32 API?

Jan 7, 2013

My setup is as follows:

There is function written C++, that must be compiled to DLL. This DLL is linked to some CAD (computer aded design) tool, that has special interface for it.

I want to add to this function some GUI (graphical user interface). So the creation of a window is necessary.

I've tried already with Win32, but without success.

The problem is that CreateWindow function requires application instance handle, that is provided by Windows itself when window is created in "normal conditions".

View 14 Replies View Related

Visual C++ :: What Is The Usual Maximum Size Of Stack Of A Win32 Program

Sep 24, 2014

I know that if the structure doesn't fit into the stack, it needs to be put onto the heap. But what is maximum size of a win32 stack in usual case?

View 4 Replies View Related

Visual C++ :: Program To Map Keyboard And Mouse To Xbox 360 Controller With Win32 And Xinput?

Aug 10, 2013

I am writing a program to map keyboard and mouse to an xbox 360 controller with win32 and xinput. I have everything going fine but when im trying to control the mouse with the thumbsticks I get problems with the movement if my program has the focus it moves fine but when I put another window in focus the movement is over sensitive here is the code I am using

Code:
if(_controllerState.Gamepad.sThumbRX >= XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE) {
GetCursorPos(&mousepos);
profile->Buttons[6]->input.type = INPUT_MOUSE;

[Code] .....

I have tried everything to fix it.

View 1 Replies View Related

C++ :: Writing And Reading Binary Data In FORTRAN?

Apr 2, 2013

I am writing a double number in Binary format to the console of program A (in FORTRAN) with the following code:

Code:
REAL*8 A
A = 12.54
INQUIRE(6, name = xstring)
OPEN(1,file=xstring, access='stream',action='write')
WRITE (1) A
CLOSE(1)

And trying to read that number by program B (in C++) which is connected to program A by anonymous pipes. Following is the reading part of program B:

Code:
#define BUF_SIZE 5000
BOOL bSuccess = FALSE;
char Buf[BUF_SIZE];
DWORD dwRead;
for (;;) {
bSuccess = ReadFile( V_hChildStd_OUT_Rd, Buf, BUF_SIZE, &dwRead, NULL);
if( ! bSuccess || dwRead == 0 ) break;
}

Note: V_hChildStd_OUT_Rd is a handle to the output of program A.

After running the program although bSuccess becomes TRUE, Buf array does not include the number (12.54) that I am expecting. If I do the same process without using the binary format it works fine and I can read the number. I know somethings wrong with the writing or reading of binary data but I do not know what it is.

View 14 Replies View Related

C :: Routines Library For Numerical Tasks

Jan 13, 2014

I am looking for C-libraries that would do numerical tasks with special emphasis on numerical differentiation of arbitrary order, numerical integration (Monte Carlo etc.) and interpolation. I would be grateful if you can provide me with some resources. By the way I already have Numerical Recipes but would like to have another resource at hand.

View 11 Replies View Related

C++ :: Call Stack Should Include All Active Sub-routines?

Feb 4, 2015

I have a general question on Call Stack of Embedded uCs.

The Call Stack should include all the Active Sub-routines.

For example, in the following sequence:

Func 1 Starts -- Call Func2 --> Func 2 Starts -- Call Func3 --> Func 3 Starts --> YOU ARE HERE

The Stack should include the Return Addresses of Func 2's Body and Func 1's Body, Right?

At any certain moment (e.g. when the uC experiencing a SW Bug), Is it possible to have the uC to get all the Active Sub-Routines from the Stack and print them (e.g. for knowing it at the moment of Bug)?

It'd debug failures, when I don't work with a Debugger.

I know that Debuggers do that - i.e. show you the Call Stack at each moment - So I am wondering if I can get the uC to to it for me every time a bug occurs.

View 1 Replies View Related

C++ :: Data Fitting Routines (Sinus Or Linear Fit)

Feb 5, 2014

Looking for data fitting routines?

I want to fit datapoints with a sinus or with a linear fit.

View 3 Replies View Related

C++ :: Separating Routines Into A Separate Implementation And Header File

Oct 18, 2013

I am trying to separate out particular sets of routines into a separate implentation and header file which can be compiled independently to the main program such that the program source consists of a file called customers.h, customers.cpp, and exercise_1_5.cpp

Each of the files should contain the following:

customers.h should contain the definition of the customer structure and the declaration of print_customers.

customers.cpp should contain the implementation (or definition) for print_customers.

exercise_1_5.cpp should contain an include of customers.h and the main program.

This is my original code from a single .cpp file

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

[Code].....

The error messages I am getting from the compiler on the customers.cpp file:

C:UsersBenDocumentsCS264lab3customers.cpp:5:22: error: variable or field 'print_customers' declared void
C:UsersBenDocumentsCS264lab3customers.cpp:5:22: error: 'customer' was not declared in this scope
C:UsersBenDocumentsCS264lab3customers.cpp:5:32: error: 'head' was not declared in this scope

View 6 Replies View Related

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 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 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

Visual C++ :: Constantly Calling Ostrstream - Private Member Access Violation

Sep 22, 2014

Code:
std::ostrstream oss;
oss << "path for " << unit << "
" << path;
puts(oss.str());

[Code] .....

Today, I just received this new fresh error, I was constantly using them, but just come to know it is a private access violation as the last error of my program. Did I use it in the wrong way?

View 3 Replies View Related

C++ :: Unicode And Win32 API Functions

Aug 11, 2014

You told me that it's better to use UNICODE all the time.

What if the Win32 Api function doesn't have a UNICODE version.

For example CryptProtectData() takes a BYTE (DATA_BLOB *) which is an unsigned char?

[Code] ......

View 7 Replies View Related

C++ :: How To Use Mouse In Win32 Console

Jan 28, 2014

I want to show and control mouse in Win32 Console. What should I do? And I want to learn MFC programing.

View 3 Replies View Related







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