|
Hello,
this is a repost as noone could/would answer my question
So here it goes again:
Can anyone tell me how to access a vc++ 6 function from vb 6 with maybe some example code or a good website ?
I looked through deja.com but found nothing good.
I am a newbie to the component stuff.
Thanx a lot.
|
|
|
|
|
Hi,
I think an easy way is to put the "C++" function into a
DLL and export it from there. Then link the DLL to the VB
program and import the function.
Best Regards
Holger
|
|
|
|
|
There is a Micosoft System Journal article that talks about this very thing. I tried the example code and it worked. I also wrote a few DLL with Visual C++ (following the steps in the article) and they worked fine with Visual Basic.
You can find the article at:
http://www.asia.microsoft.com/msj/defaulttop.asp?page=/msj/0498/inthisissuefeatures0498.htm
gl
Jonathan Craig
|
|
|
|
|
Hi,
I would like to get the TZI key value for a Timezone in the registry so that I can tell when the Daylight Savings Time and Standard Time start.
I'm using RegQueryValueEx to get the value. It returns the size correctly but I've no idea how to parse the DWORD returned to get the date information.
DWORD size = sizeof(DWORD), type = 0, data;
LONG res = RegQueryValueEx(hKey, valueName, NULL, &type, (BYTE*)&data, &size);
TIA
Lynda
|
|
|
|
|
Hi,
Why do not use the API function "GetTimeZoneInformation".
I think it's much easier to handle.
Best Regards
Holger
|
|
|
|
|
It's not the current timezone that I need the information about. It's all the other ones listed in the registry.
Regards,
Lynda
|
|
|
|
|
Is there a quick method to make a label in a dialog a hyperlink to a webpage? (say, invoke the browser, and load the URL).
Thanks all.
|
|
|
|
|
See this URL
http://codeguru.earthweb.com/controls/hyperlink.shtml
or You can create new class, derived from CStatic.
OlegO
|
|
|
|
|
Hello,
My mainframe has a dialog-bar with four buttons. When i press a button, it becomes selected as usual. T.i. it gets a black border and a dashed focus-border. But when i press another button, only the focus-border disappears from the first one. The black selection border stays. So, after pressing all four buttons, they all have an ugly black selection border. Any ideas on how to get rid of those borders? Are those borders a style or a state?
Thanks!
|
|
|
|
|
Hi,
I fixed the problem myself eventually.
It seems that the buttons get the BS_DEFPUSHBUTTON (default button) style after pressing them. Don't ask me why.
So, after pressing a button, i reset the style back to non-default pushbutton.
style = button->GetButtonStyle();
style &= ~BS_DEFPUSHBUTTON;
button->SetButtonStyle(style);
That works.
|
|
|
|
|
has anyone else discovered a bug in the tree control when usuing unicode such that a redraw causes a memory leak and a crash ... after DeleteAllItems() is called it seems that some internal memory allocations are not handled properly ... after 4 days of mussing around i resorted to completely destroying the control and re-creating it every time it needs to be redrawn ... that worked
weird i thought ... then i remembered that windows itself is just a bunch of code written by a bunch of programmers too so it could have errors
any clues would settle a question in my head at least
thanks
|
|
|
|
|
I want to know how to get the color of the window, when my mouse move and point at a object!!!! Anyone can help??
Thanks!
|
|
|
|
|
Try GetPixel API using the desktop device context as follows:
HDC DesktopDC = GetDC(NULL);
COLORREF color = GetPixel(DesktopDC, x, y);
// where x and y are the mouse coords.
|
|
|
|
|
Hi Everyone,
I’m using Visual C++6, and I have this question regarding Database programming with Microsoft Access.
How do I get a certain row’s field names and it’s values??
For example, let’s say I have an Access table such as:
CustID CustName Item Price
1 John Pen 1.99
2 Mike Mirror 5.00
3 Erin Pencils 1.00
4 Joe Eraser 1.50
5 Tim CD 14.99
How do retrieve the data of certain rows such as row 2 and row 5??
I would like then to take the values of the selected rows and write it into a new table somewhere else.
Is there a simple method such as (SELECT this row and INSERT INTO a database)??
If anyone has any idea, PLEASE LET ME KNOW.
Thanks in Advance.
Steve
P.S. How do I only retrieve the FIELD NAMES of a table?
|
|
|
|
|
databases have tables of tables to keep track of what the user databases are all about ... thats how they pull out the right datatypes and values etc etc ... its called metadata and its stored in the system tables ... if you enable the showing of system tables you can query the db for info on the other tables and select whatever you want
all well and good but slower than keeping your own table of tables containing just what you need to know ... which is what i do to get stuff like configurable columns in an abitrary data view, etc etc
|
|
|
|
|
Lauren,
Thanks for the reponse. I've looked up metadata in the MSDN library but it was not listed under C++ codes. Can you provide me with some sample codes??
Thanks
Steve
|
|
|
|
|
i should say that i dont use crecordset or cdatabase objects as i find them a bit clumsy ... maybe i'm just old fashioned
|
|
|
|
|
G'day Steve,
Check out CDaoTableDef and CDaoFieldInfo.
Here's a (very) rough example...
<br />
CDaoDatabase db;<br />
db.Open("DatabaseFileName.mdb", ...other parms...);<br />
<br />
CDaoTableDef td(&db);<br />
td.Open("MyTable");<br />
<br />
for(int i = 0; i < td.GetFieldCount(); i++){<br />
CDaoFieldInfo fi;<br />
td.GetFieldInfo(i, &fi);<br />
<br />
TRACE(_T("Field[%d]: %s\n"), i, fi.m_strName);<br />
}<br />
<br />
td.Close();<br />
db.Close();<br />
Hope this helps,
Steve
|
|
|
|
|
I guess I should have mentioned my exmple (above) is for fetching the field/column names from an existing table in a MS Access database.
Steve
|
|
|
|
|
Steve,
Thanks for your response and codes.
How can I then retrieve the values of the table by certain rows?
Steve
|
|
|
|
|
G'day Steve,
Have a look at the CDaoRecordset class in the VC++ docs.
Something like the following should work. (I haven't tried this as I use Class Wizard generated recordsets, but I think is hould work OK).
CDaoDatabase db;
db.Open("AccessFileName.mdb", ...);
CDaoTableDef td;
td.Open("MyTable");
CDaoRecordset set(&db);
set.Open(&td);
int nNumRecords = set.GetRecordCount();
set.Move(5);
COleVariant var;
set.GetFieldValue(_T("Name"), var);
set.Move(3);
set.GetFieldValue(_T("Name"), var);
set.Close();
td.Close();
db.Close();
Hope this makes sense.
Steve
|
|
|
|
|
Steve,
Thanks for your input again. But I'm having trouble using the codes.
I'm getting the following error messages:
'CDaoDatabase' : undeclared identifier
same thing goes for CDaoTableDef and CDaoRecordset.
But the thing is that I've already declared the following in my program:
#include afxdao.h
Am I missing something else??
PLEASE LET ME KNOW. Thanks again!
Steve
|
|
|
|
|
Can I assume any of these dlls will always be on a windows system?
Advapi32.dll
Gdi32.dll
Kernel32.dll
Mfc42.dll
Msvcrt.dll
User32.dll
I ran the dependency checker and this is what it listed. However, I thought dlls like kernel32.dll and gdi32.dll should already be on a windows system. How can I check to see what dlls should already be on a system and what dlls I can distribute legally?
|
|
|
|
|
All those except MFC42.DLL and MSVCRT.DLL are part of the OS and will be present. Check the {VSTUDIO DIR}\vc98\redist.txt file for a list of redistributables.
|
|
|
|
|
Anyone know how to use the Tab Control??? I have difficulty of using the tab control!! Any can write a simple Tab Control example for me???
Thanks!!
|
|
|
|