Visual C++ :: Create MFC OCX Using DLL

Aug 28, 2014

I am trying to create a OCX from a C++ dll., Here's the scenario I have a C++ dll and this dll needs to be called in VB.net program my boss want's me to create an OCX out of this.

C++ dll and use it in a VB.net class library, apparently I have created an OCX but it requires a form but the VB.net program is a class library.

View 5 Replies


ADVERTISEMENT

Visual C++ :: Create Web-browser With ATL?

Aug 11, 2013

I'm trying to create a simple webbrowser at my app.

code sample:
....
ATL::CAxWindow m_wndContainer;
ATL::CComPtr<IWebBrowser2> m_spWebBrowser;
HWND hWnd = m_wndContainer.Create(NULL,
CRect(0,0,200,100),
(LPCTSTR)0,
WS_CAPTION|WS_THICKFRAME|WS_OVERLAPPED|WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
CoCreateInstance(CLSID_WebBrowser,NULL,CLSCTX_INPROC,IID_IWebBrowser2,(void**) &m_spWebBrowser);
...

everything is work fine except the fact the it seems that it create an IE version 7.0 and my machine have IE 8 installed.

it not suppose to create the IE according to my installed version?how do i suppose to do it?

View 1 Replies View Related

Visual C++ :: How To Create A Dialog As DLL

Feb 13, 2014

How can I create a dialog as a DLL ? I have a SDI MFC app (CView is based on CFormView) and from a button I want to load a modal dialog, but that dialog must be developed as DLL ... I didn't find something that fit my needs on internet ... P.S. I have only VC6 !

View 14 Replies View Related

Visual C++ :: Create A New Toolbar With Icons?

May 23, 2013

how to create a new toolbar with my icons in vc++?

View 3 Replies View Related

Visual C++ :: How To Create Image Buffer In MFC

Jan 27, 2013

how to create, initialize, and maintain a memory device context that works as a local buffer for images? The idea is to maintain some large images in local DCs and bitmaps, and only bitblt them to screen in OnDraw().

What I did so far was was to define CDC and CBitmap objects as members of my View class, and then tried to initialize them with the sequence that begins at "// Initialize buffer". I placed that sequence in either OnInitialUpdate, or PreCreateWindow, or OnPrepareDC, or the view constructor, to no avail. The code always crashes in OnDraw, and I've noticed that the m_hDC member of myDevice is zero at that point.

Obviously, the initialization is wrong and MFC does (too many) things in the background which I'm not aware of.... My question was where can I read about that?

Code:
class CMyView : public CScrollView {
// ...
CDC myDevice;
CBitmap bmp;
CBitmap *oldbmp;

[Code] .....

View 5 Replies View Related

Visual C++ :: How To Create MDI Child With Borders

Jan 7, 2013

How can I create MS Word 'print layout' like interface. The attached picture says it all. Basically I want a shaded area around my document just like word so it gives a feel of the 'page'.

I was hoping I can override some function somewhere and along that lines tried playing around with below but that didn't work.

Code:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) {
if( !CFrameWndEx::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.cx = 250; // just playing around with size
cs.cy = 250;
return TRUE;
}

How can I do that?

View 6 Replies View Related

Visual C++ :: How To Create A Basic Window

Dec 29, 2012

I want to create a basic window using visual c++ 2010 express.

View 1 Replies View Related

Visual C++ :: How To Fork Or Create Thread

Dec 23, 2012

How can I implement the paradigm demonstrated by the code below to run on WinXP?

I want to fork a process or create a thread that shares global variables with the parent process/thread.

The child process/thread monitors the progress of the parent process/thread.

I cannot find documentation for a fork function per se, a Unix term. It might be called something different for WinXP.

I would be happy to use threads instead. But I'm rusty even with Unix application threads; and I know nothing of WinXP application threads.

So any turnkey implementation that demonstrates the simplest use of process or thread functions for my purpose demonstrated below.

In either case, do "forked" processes and threads share global address space in WinXP, as they do in Unix?

I would prefer to avoid the overhead of IPC mechanisms. The "overhead" includes my own relearning curve.

The GUI screwed up my indentation. I would try to correct it. But the proper indentation appears when I edit the posting. I suppose I need to insert real tabs. Haven't figured out how (yet).

Not even real tabs work; and I cannot get the "paste as text" button to behave as I expect. What is the trick for posting indented text in this GUI?

#include "stdafx.h"
#include <stdlib.h>
#include <Windows.h>
long curCount;
int isRunning;
int _tmain(int argc, char* argv[]) {
curCount = 0;
isRunning = 1;

[code]....

View 4 Replies View Related

Visual C++ :: Create NPAPI Plugin?

Jul 28, 2014

Is it possible to create an NPAPI Plugin in VC++, that is cross browser compatible or should atleast work in Chrome Browser?

View 1 Replies View Related

Visual C++ :: MFC And Create Folders In Outlook?

Mar 5, 2014

I am wokring on a project that has used an MFC DLL in conjunction with Outlook to send and archive mail. I need to be able to create folders for integration from an older mail system. I have looked online to see if there are examples in C++ (since I have to modify the existing C++ dll to include the funcitonality). I realize it is much simpler using VBA or C#, but I am limited with my choice. I essentially want to use the MFC type lib for Outlook 14 and use the CMAPIFolder,CFolders create folders in the Inbox.

here is a sample of the code:
//I have included the necessary header files
COleVariant covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
//start outlook
if (!olApp.CreateDispatch(_T("Outlook.Application"), &e))

[Code]....

View 5 Replies View Related

Visual C++ :: Create X64 QT Project By Default?

Mar 1, 2014

I compiled the source code of QT5.1 to work with Visual Studio 2010.

But it always start off with a win32 project, so that I need to change the settings every time.

How do I kick start with a x64 project by default?

View 1 Replies View Related

Visual C++ :: How To Create Edit Box In CView

Dec 16, 2013

I'm trying to create an edit box in a CView.So far, this is how far I've gotten:

With this code

Code:
// .h
CEdit m_MyEditField;
// .c
m_MyEditField.Create(WS_CHILD | WS_VISIBLE,CRect(40,40,500,Y+55),this,0x1552);
m_MyEditField.SetWindowText("this is my CEdit field");

As you can see, the edit box doesn't look like the ones in a dialog, which is what I'm trying to accomplish.

Is there possibly some other class I should be using for the edit box?Or another setting for .Create?

View 2 Replies View Related

C/C++ :: Create A Directory / Folder Using It In Visual Studio

Jan 26, 2014

C-> Visual studio 2010-> windows 7

How to create a directory / folder.( to browse/save my files to a directory.) how to specify the path?

I googled , but i cant able to find appropriate as it is showing all in the C#, C++ , objective C. But not in C.

Here i am writing a sample program to my POS device .problem here is it is not taking mkdir(direct/dir.h header file)function. Any alternative is there to make a directory?

View 1 Replies View Related

Visual C++ :: Create Histogram From A Set Of Values In OpenCV?

Mar 9, 2013

I have a text file which consist of several values. These values represent distance from origin to any point in the triangle. How can I create histogram from these values? Is there any functions in OpenCV which can create histogram from these values? Below my sample values are given:

..........................

3.4 1.2 6.9 0.2 5.1 2.9

........................

View 1 Replies View Related

Visual C++ :: Debug Assertion On ActiveX Create

Oct 10, 2013

I have a MFC Com Dll that has a CDialog. In the OnCreate event I create an ActiveX control. The dll is hosted inside an executable of mine. In this scenario everything works fine!

The dll is also called from an external executable and then a Debug Assertion in OCCSITE.cpp occurs when I create the ActiveX control. I suspect that in the executable there is no AfxOleInit. I spend some time with this problem and tried to CoInitialize, OleInitialize, AfxOleInitModule and even AfxOleInit in the dll. But all that does not change a thing. If I understand the mechanics then this is an intended behaviour and should be done in the host exe.

What I observed in the OCCSITE.cpp:

Code:
_AFX_THREAD_STATE* pState = AfxGetThreadState();
if (!pState->m_bNeedTerm && !AfxOleInit())
return hr;

In my executable m_bNeedTerm is 0 and in the external one (where the ActiveX does not work) it is -1. In AfxOleInit this is explained as a special flag to prevent the dll from doing an unnecessary OleInitialize. But as I said even if I call OleInitialize myself I get the Debug Assertion and the ActiveX is not visible.

Is there anything I can do to make the ActiveX control work in the external application? Obviously I cannot Change anything in the application...

View 1 Replies View Related

Visual C++ :: Create A Column Of Buttons In A ListView?

Mar 26, 2013

Is there an easy way to create a column of buttons ina listView?

I need that every file of the listView has a button in the first cell. Is that possible?

View 2 Replies View Related

Visual C++ :: Create A Function Using Rot To Encrypt Strings

Sep 30, 2013

I need to create a function using rot to encrypt certain strings the function begins like this

#include "encrypt.h"
std::string encrypt (std::string text, int rot) {
for (int i
and ends like this
return NULL;
}

dont need to write the string encrypted and dont need to crate a decrypt function.

View 4 Replies View Related

Visual C++ :: Create Own Property Which Passes Parameters

Apr 4, 2013

Is it possible to create property which I can pass parameters? Here is what I would like to do:

__property double a = {read=getA("a"), write=setA("a")};
__property double b= {read=getB("c"), write=setB("c")};

double getA(char *a);
void setA(double value, char *a);

double getB(char *a);
void setB(double value, char*a);

View 3 Replies View Related

Visual C++ :: Can Create Graphical Extension For VS 6.0 Debugger

Feb 8, 2013

I'm digging an old project and i can't switch to a newer visual studio.

I want to plot float data array during debug.

I know some IDE's have such option. There is a separate window in which we can plot data.

Can I write such plugin for Visual Studio 6.0 using visual studio SDK?

Does it support 6.0 version?

View 1 Replies View Related

Visual C++ :: ImageList Create Function - Size Of Image

Jul 31, 2014

An ImageList_Create() function (see here) takes 2 parameters: cx and cy which are the width and height of each image.

Everything is good if I know in advance what size my images will have. But what if I don't?

Let's say I select 32x32 and my images are sized as 16x16. What will happen with the image list? Or my images are 48x48 and the image list should grow to accomodate the extra space. Since on Windows image list is just one big bitmap, will the height of the image list shrink/grow to 16/48 or not? Is there a way to test such behavior?

The problem I'm having is to check whether the actual images will be truncated when they are bigger that the image list initial size or not or whether I will see some extra space if the images are smaller.

The closest way I see is this function, but I am not sure its the right one to apply to the image list itself and not to the image inside the list.

How to test this properly and reliably on Windows XP+?

View 3 Replies View Related

Visual C++ :: Recursion - Create Directories And Upload Files?

Jul 21, 2013

The code below is suppose to create directories and upload files, but it is not working. What can I do to make the code work?

Code:
void CRECURSIONDlg::Recursion(CString sPath) {
hInternet = InternetOpen(TEXT("BEAR FTP"),
INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0);

// Make sure there are no errors
hIConnect = InternetConnect(hInternet,"192.168.1.4", 211,
"******", "*****", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);

[Code] ....

View 6 Replies View Related

Visual C++ :: Create A Program That Perform Same Calculation For Every Oscillation

Jan 17, 2014

I am reading from a text file and want to create a program that will perform the same calculation for every oscillation.

The text file I'm reading from is attached to this post. A3.txt

The program that I've written is as follows:

Code:
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream inFile ("AP1.txt");
ofstream results_file ("APDuration.txt");

[Code]...

Where I'm having trouble is in having the inFile.seekg function iterate to the next series of values.

Here is what the data file looks like in a graph:

In a nutshell, my program will read the duration of each action potential from a point called "dVmax" (where the upstroke is at its maximum upward rate of change) to the point of 90% repolarization (on the downstroke where 90% of the total wave amplitude is subtracted from the volts at peak amplitude).

If you would like to test my program on one action potential, here is one action potential : AP1.txt

View 8 Replies View Related

Visual C++ :: Windows Form - Create Method With Parameters

May 16, 2013

I am wanting to separate the logic from the visual, but I'm having problems when calling the method that controls the actions of the progress bar timer.

Code:

ifndef PROGRESS_BAR
define PROGRESS_BAR
class Progress_bar{
public:
void set_Progress(ToolStripStatusLabel^ label,Timer^ time){

[Code] ....

The way that I'm calling this method on Form1.h

void set_Progress(toolStripStatusLabel1 ,timer1);

Errors:

Error1error C2182: 'set_Progress' : illegal use of type 'void'h:cry_devprogrammingc++school_mediaschool_mediaForm1.h277
Error2error C2078: too many initializersh:cry_devprogrammingc++school_mediaschool_mediaForm1.h277
Error3error C2440: 'initializing' : cannot convert from 'System::Windows::Forms::Timer ^' to 'int'h:cry_devprogrammingc++school_mediaschool_mediaForm1.h277

View 3 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++ :: Create A File That Ask The User To Enter His Info

Nov 9, 2014

What I want to do is create a file that will ask the user to enter his info,n then store it in a text file The screen will ask the user if he wants to update his info. if he says yes then the screen will be cleared and the old info will be printed on the screen. The user will enter his new info that will be stored in a new file. My problem is that once the user finishes entering his input the program just closes D: and the rest of the program won't run.

Code:

int main()
{
string ans;
ofstream Xfile("original.txt");
cout <<"Enter your name and address please"<<endl;
cout<<"Press Ctrl+Z+Enter when you are done"<<endl;
string name_and_street;

[Code]...

View 3 Replies View Related

Visual C++ :: Create Process And Wait For Input Idle

Feb 13, 2014

I have a problem with creating a process and waiting until the main window of the new process was shown. I thought I can wait for it with

WaitForInputIdle(pi.hp,INFINITE);

But when the function returns, the handle of the main window of the new process is not available. If I include also a ::Sleep(), the new window is available. Sleep is a bad solution. How can I do it?

View 3 Replies View Related







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