|
Yea, thats a great attitude, dude.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
After reading several boards, I'm close but no cigar. I have an existing C++ app that calls my vc6 dll which calls a vb6 dll. That seems to work fine but when I try to call a function in the vc dll from the vb dll. For this test, the calling vc app does a simple call to fakePlugIn().
The vc dll:
#include "stdafx.h"
#import "testvb.dll"
using namespace testvb;
extern "C" __declspec(dllexport) fakePlugIn()
{
HRESULT hresult;
CLSID clsid;
_vbdllcls *t;
CoInitialize(NULL); //initialize COM library
hresult=CLSIDFromProgID(OLESTR("testvb.vbdllcls"), &clsid);
hresult=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,__uuidof(_vbdllcls),(LPVOID *) &t);
if(FAILED(hresult))
{
AfxMessageBox("Creation Failed");
return false;
}
t->InVbDll("string to vb dll"); //call the vb dll
t->Release();
CoUninitialize();
return true;
}
extern "C" void __declspec(dllexport) Callback(void)
{
AfxMessageBox("in callback");
}
The vb code:
Public Declare Function Callback Lib "testcpp.dll" () 'this is in a module
Public Function InVbDll(ByVal s As String) As Long 'this is in class vbdllcls
MsgBox s
Callback
End Function
With Callback defined as __declspec(dllexport), the message box in Callback gets executed but then I get a runtime error: Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.
OK so I tried __stdcall instead. Then I don't make it to the Callback and get a runtime error:
First-chance exception at 0x77e73887 in cppshell.exe: 0xC000008F: Floating-point inexact result.
First-chance exception at 0x77e73887 in cppshell.exe: Microsoft C++ exception: _com_error @ 0x0012fbac.
I've tried various combinations as well with the same result. Ultimately, I'd like to pass strings into and possibly out of Callback, but one step at a time.
Any light you could shed on this would be appreciated!
|
|
|
|
|
.... you have already run the App Wizard without including database support?
I have a DB project that is Dialog based from the App Wizard. It is replete with calls to create CDatabase and CRecordset objects and I am manually building the query strings and calling ExecuteSQL(); everywhere. It works, but is rapicly getting unmanageable. I would very much like to associate dialog boxes with a CRecordset member variable like the App Wizard does for you if you select a DB app.
SHould I just throw away all the work I have done and restart, or is there a way to include DB support for dialog boxes after the fact?
|
|
|
|
|
I am working on an MDI MFC app and have been making great progress on it, but all of sudden, when I try to use my vertical scroll bar to scroll the rich edit view, it doesn't respond. Mind you, I can still use the mouse wheel to scroll up and down, but not directly by using the vertical scroll bar.
It was working fine up until yesterday (been working on this project for roughly 2 months) when I must have changed something or adding something to the code that screwed it up, but for the life of me, can't figure out what. Please help!
Any suggestions as to what to change or edit I would appreciate!
|
|
|
|
|
Hi
does ne1 know the best way in c++ to detect if i have
a network connection, ie. connected to the internet
thanks
si
|
|
|
|
|
Does this help?
http://www.pcausa.com/resources/InetActive.txt
|
|
|
|
|
|
i dont know about the other replies and if the info there works everytime but i found the most reliable way was to try to ping a site that (hopefully) wont be down
if theres a better way they invented recently i'll be happ to know about it too
"there is no spoon" biz stuff about me
|
|
|
|
|
I've been using the following function with success. It returns
TRUE if a connection is available, and takes less than
a sec in either case:
<br />
BOOL Online()<br />
{<br />
DWORD dwState = 0; <br />
DWORD dwSize = sizeof(DWORD);<br />
return InternetQueryOption(NULL,<br />
INTERNET_OPTION_CONNECTED_STATE, &dwState, &dwSize)<br />
&& (dwState & INTERNET_STATE_CONNECTED);<br />
}<br />
Credit: I got this from Paul Dilascia's column in MSDN mag a while
back.
|
|
|
|
|
hi,
does anybody know how to install the TCP/IP via C++?
furthermore, i have to know how to set the IP number and anything like this...
Thx
CND
|
|
|
|
|
I don't think this is going to be an easy task. Different versions of windows (even service packs) have different dialogs and setup. I think Win 2K+ comes with TCP/IP installed by default. As for the IP address there are programs on this site that will do that for you. One thing to note is you can not assume that a person has 1 network card they may have 0 or 2.
John
|
|
|
|
|
Does anyone know if GDI+ 1.1 is included in the latest platform SDK. It is not part of VS.NET 2003 which is still using 1.0. The MSDN doco refers to 1.1 for a number of classes that I'm interested in.
There seems to be no information about it on the MSDN website (although it's hard to tell with the current search engine).
A few postings in newsgroups seem to indicate that the only source of this at the time of writing is as part of one of the Office 2003 products, does anyone know if this is the case.
Ta,
Jason Wilden.
Displaced Aussie. Currently in London, normally living in Melbourne.
modified 10-Jul-19 21:02pm.
|
|
|
|
|
I think it should come with the latest Platform SDK. I have it, and I think I got it by downloading the Windows Server 2003 RC2 SDK.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
jdunlap wrote:
I have it,
How do you know you have version 1.1 ?
None of the headers i have contain version information.
The dll version is 5.1.3097.0 which doesn't tell me if it's version 1.0 or 1.1 of the API.
I have the Feb.2003 Platform SDK installed.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Up until this time, i've been programming with turbo c from 100 years ago, and i haven't had any luck communicating with a meter. The code is not the problem, we've gotten similar programs to work, but we want to try using c++ to code in.
I've been using the bioscom() function of tc, which is very easy, but now that we're looking at c++, i haven't found anything similar.
Can someone point me to somewhere that has a general description of how so use c++ to communicate with a serial port?
*.*
cin >> knowledge;
|
|
|
|
|
|
In Win32 API you use CreateFile() to open the port. Look at the docs for that. ReadFile() and WriteFile() are used to send and receive data. CloseHandle() closes the port.
John
|
|
|
|
|
Hi there,
I have the complete path of a file in a CString variable and I want that first the appropriate application should be executed and then the file should be opened.
For ex,
If the file name is "abc.doc" then first the application MS-WORD should be invoked and then the file should open in it.
Please tell me how to do this.
Gaurav Gumber
|
|
|
|
|
You can do that with ShellExecute
|
|
|
|
|
Hi,
I have a Dialogbar with some edit control into it. I want to set the focus on the first one. The focus seem to work right because the caret appear in the first edit control but my text in the control is not selected. what am I doing wrong? I would like to have the text selected so that I could change my text into the control without having to delete it first.
thanks for helping
Mykel
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Use SetSel(..)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cedit.3a3a.setsel.asp
|
|
|
|
|
Are you calling MyEdit.SetSel(0, -1); ?
This should select the whole text content of your edit box.
[EDIT]This is the same as calling
::SendMessage(
(HWND) hWnd,
EM_SETSEL,
(WPARAM) 0,
(LPARAM) -1
); [/EDIT]
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I have the same kind of problem ...
when my editbox received the focus, I want to select all text in it.
ON_EN_SETFOCUS(CMbCoordEdit::IDC_EDIT2, OnSetfocusControl2)
...
void CMbCoordCtrl::OnSetfocusControl2()
{
m_edit2.SetSel( 0, -1);
}
That doesn't work when clicking in the editbox.
Setting the selection manually from another function works, but not like that.
any hints ?
Thanks.
Maximilien Lincourt
"Never underestimate the bandwidth of a station wagon filled with backup tapes." ("Computer Networks" by Andrew S Tannenbaum )
|
|
|
|
|
hi there
i want to access a windows share programmaticly ( e.g. \\mycomputer\mydir\myfile)
i can do this by write code like this: cfile( "\\...", ... ) ... but a dialog is shown and asks for a username & password ...
is there any api or something like that to set username and password programmaticly?
thanks for reading
|
|
|
|
|
hello,
can someone tell me how to disable the drag&drop in a RichEdit control ?
Do I have to use IRichEditOleCallback and how ?
1MB of thanks in advance
|
|
|
|