|
oh my god. I am such an idiot!
norm
|
|
|
|
|
just want to thank u one more time!
i looked at the damn code for like 3 hours!
norm
|
|
|
|
|
who can tell me?
thanks!
-----------------------------
Mr.Whelk
-----------------------------
Zhuhai City ,Guangdong ,China
|
|
|
|
|
I don't know if it is possible in ADO, you need to get the IJetCompact interface and call its Compact method. It is dead easy using OLE DB:
<br />
CDataSource src;<br />
<br />
CComPtr<IJetCompact> spCompact;<br />
hr = src.m_spInit->QueryInterface(IID_IJetCompact, (void **) &spCompact);<br />
<br />
CDBPropSet init(DBPROPSET_DBINIT);<br />
init.AddProperty(DBPROP_INIT_DATASOURCE, "compacted.mdb");<br />
<br />
hr = spCompact->Compact(1, &init);<br />
|
|
|
|
|
i use msado15.dll to operate database in ado
can you tell me how?
-----------------------------
Mr.Whelk
-----------------------------
Zhuhai City ,Guangdong ,China
|
|
|
|
|
You can use CDaoDatabase from MFC to do it easily enough. Not sure about ADO though
-Alex
|
|
|
|
|
we want to use ado to realize the popose
-----------------------------
Mr.Whelk
-----------------------------
Zhuhai City ,Guangdong ,China
|
|
|
|
|
Hi
can anybody guide me to load Toolbar dependent bitmaps in my popup menu which will appear on RButtonclick on a DialogBox(or Bitmap) in a Formview.will be so thankful if you give me
the code.
thanks and regards
ThomasKennedyBose
|
|
|
|
|
Can any body help me i'm try to create in CDocument view an Rich edit control that will that will allow me have a line count on the side when the user type any thing into the edit. Also beside the CRichEdit I want the color to be gray and white for CRichedit. SO i kind of looks like Visual Studio Editor or any coding editor.
Can anybody help me to get this going.
Thanks alot.
|
|
|
|
|
This is probably a stupid question (I haven't had much sleep in the past 3 days).
How can I tell Visual C++ to perform an extra step when compiling each .cpp file. What I want to do is basically what BoundsChecker does when you perform a compile. You see "compiling something.cpp" followed by a line reading "instrumenting something.cpp".
I know about custom build steps but I can't seem to get this to do what I want???
|
|
|
|
|
|
Hi All.. I have a global variable CArray < struct, struct&> a; declared in the same place as theApp global variable get declared.
I know if I want to use the global variable include in the other .cpp files, I have to call that global in such way
extern CArray<struct,struct&> a;
Then I Rebuild the project, Iand got linking error...
[code]
error LNK2001: unresolved external symbol "class CArray<struct dishinfo,struct="" dishinfo="" &=""> theMenu" (?theMenu@@3V?$CArray@UDishInfo@@AAU1@@@A)
Debug/ResturantSystem.exe : fatal error LNK1120: 1 unresolved externals
[/code]
why do i get error??
|
|
|
|
|
First of all, to fix this problem, declare the variable extern in your stdafx.h, and declare it in stdafx.cpp. Voila, visible everywhere.
Secondly, DON'T do this. Global variables are a terrible idea. If you must, then at least put them in a namespace. It's far better to make them members of your main window and access them that way.
Finally, you should investigate std::vector, check out the STL articles here on CP. CArray is really a terrible product, and is generally used by people who either don't know about the STL, or are put off by the awful docs in the MSDN. I've solved problem a, and the articles on this site will fix problem b. I think you'll be surprised how much nicer/powerful it is than the stuff that MFC ships.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Thank you very much for your explaining and suggestion.. I'll learn about STL..
Thank you Chris...
|
|
|
|
|
Glad to help.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
whats wrong with my string?
I am trying to find a record in a database where one parameter is partially given ( LIKE 'm_val'). I don't get any database errors, but no info either.
CString m_cat, m_val;
// Build the SQL statement
SqlString = "SELECT * "
"FROM new WHERE cat='";
SqlString += m_cat;
SqlString += "' AND filename LIKE '";
SqlString += m_val;
SqlString += "*'";
Any helps really appreciated
shotgun
|
|
|
|
|
I believe the wildcard character is %, that is, I know % works, but I've never tried *. Do your values start with m_val, the ones you expect to find ? Are they in the table called 'new', and in the 'filename' column ?
I find the best way to isolate this sort of problem is to build the query. Do a select *, a select cat, a select * where cat equals a known to be present value, etc.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian is right - '*' won't work as a wildcard but '%' will.
-Alex;)
|
|
|
|
|
On MSDN, in documenation for API structures, the following examples are common:
typedef struct _RASDIALPARAMS {
DWORD dwSize;
TCHAR szEntryName[RAS_MaxEntryName + 1];
TCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1];
TCHAR szCallbackNumber[RAS_MaxCallbackNumber + 1];
TCHAR szUserName[UNLEN + 1];
TCHAR szPassword[PWLEN + 1];
TCHAR szDomain[DNLEN + 1] ;
#if (WINVER >= 0x401)
DWORD dwSubEntry;
DWORD dwCallbackId;
#endif
} RASDIALPARAMS;
Apparently (WINVER >= 0x401) refers to Windows NT 4.0 with enhancements and on this platform, the last 2 entries are required. However, Windows 98, whose version is 4.10 doesn't require them ...
Isn't 4.10 > 4.01? Or am I not understanding something?
Thanks
A reasonable man adapts himself to the world. An unreasonable one persists, trying to adapt the world to himself. That is why all the progress in the world depends on the unreasonable men.
|
|
|
|
|
The project is to simulate a Finited State Machine running with a specific input sequencr. Just highlight the path it goes through.
The problem is to set a Pause button to stop and restart it. How??? Do I has to use thread?? If yes how to
( My view class is base on CScrollView )
Thanks!!
|
|
|
|
|
Does anyone know of a function/routine to tell me how many files are on a disk drive? Can't find anything in MSDN.
|
|
|
|
|
I would use the FindFirstFile and FindNextFile .
You specify "*" as filter and then count the files. This way you also can count only specific files with specific extensions, or only count directories.
I don't know of any function which directly returns the number of files on a drive.
-Dominik
|
|
|
|
|
Thanks for the help. I thought of also doing that but it would be pointless since I need this number to be set for a progress bar which is active during searching of the hard drive for files so it kind of defeats the purpose of doing that twice...any other ideas?
|
|
|
|
|
Another idea:
First step: Get the used size on the disk (capacity minus free space). Use this function:
BOOL GetDiskFreeSpaceEx(<br />
LPCTSTR lpDirectoryName,
PULARGE_INTEGER lpFreeBytesAvailableToCaller,
PULARGE_INTEGER lpTotalNumberOfBytes,
PULARGE_INTEGER lpTotalNumberOfFreeBytes
);
Second step: Every time you process a file, subtract its size from the space.
Now you can compute the remaining bytes to process. Set this into relation and make a nice status bar.
-Dominik
|
|
|
|
|
Thanks, that should do it...why didn't I think of that?!
|
|
|
|