|
actually the problem is i don't know how
call shell funtions such changing directory..
creating files .etc..
|
|
|
|
|
|
I have just completed 145 Gnu makefiles that allow anyone
with the free MinGW tool set to compile and execute all of
the example programs which Charles Petzold describes in his
"Programming Windows Fifth Edition" book, which is the
standard reference book on Microsoft's WIN32 API.
I freely distribute these 145 makefiles in a .ZIP file,
along with an installation program that will copy them into
Petzold's directory structure, from my web page at:
http://www.computersciencelab.com/Petzold.htm
Only 5 of the 145 programs require user intervention to
compile with the Gnu compiler, which is not bad for porting
that many programs to a new compiler, especially given
Microsoft's lax adherence to standards.
You are free to use these makefiles with whatever version
of the MinGW tools you prefer, but I created them for use
with the MinGW based C++ integrated development environment
that is part of my computer programming curriculum.
Petzold's book is expensive enough, so it's great that these
makefiles and the MinGW tools mean that you don't need to send
another $100 Microsoft's way to purchase their Visual C/C++
compiler.
John Kopplin
|
|
|
|
|
Excellent forum to place this advertisement. 90% of us do not like to work with VC++ (Not) .
|
|
|
|
|
Well actually, Visual C++ is my primary development tool,
and that is why I am familiar with this web site and use
it as a resource.
But even those who have no interest in the Gnu compiler
may still be interested in my list of errata for the
Petzold book, which more than doubles the size of the
errata list that Petzold shows on his web site.
John Kopplin
|
|
|
|
|
It has nothing to do with that, he's simply offering people an option. Some people can't afford VC, so what he has done is given them the abbility to compile the samples without having to own a copy...
cheers,
-B
|
|
|
|
|
I would like to enumerate the netbios names of a machine.
nbtstat -A IPAddress command can do this very easily. It displays all the netbios names.
I searched msdn and codeproject but I could not find an example.
How can I do this ? Is there an api or do I need to craft a UDP packet by myself and send to port 137 of the target machine ?
Thanks
Orcun Colak
|
|
|
|
|
Hello All,
I have a requirement to read Foxpro dbf files without using ODBC or any other sane methodology, I remember a long time ago I did this in C using a structure but It's so long ago I've forgotten. What I've tried so far is creating a class ( you might gather my C & C++ has gathered dust ) as below but it is not satisfactory ( fields overflowing etc... ). The sample table I've been using has three fields, clm_ref c(10), name c(50) and salary n(15,2),where c(2) is a character field of 2 chars and n(15,2) is a numeric field of 12 digits with precision of 2, here's what I've got so far.
Class Record
{
char filler[1]; */ required for deleted field */
char clm_ref[10];
char name[50];
char salary[15];
void RecordGetData(ifstream &);
};
Record::RecordGetData(ifstream f_in)
{
f_in.read((char*) this,sizeof(*this));
}
int main()
{
Record Claims;
ifstream ifile;
ifile.open("mydata.dbf");
DBF_HEAD dbf_head;
ifile.read((char*) &dbf_head,sizeof(DBF_HEAD)); */ Header info */
ifile.seekg(dbf_head.data_offset,ios::beg); */ seek to data offset*/
Claims.RecordGetData(ifile);
cout << "Claim ref " << Claims.clm_ref << endl;
}
While Claims.clm_ref contains the clm_ref data it also contains part of the name, I'm lost any ideas much appreciated
regards
Pete Kane
Pete Kane
|
|
|
|
|
CodeBase [^] acceptable?
"Well I'm just a hard working corporate slave, my mind should hate what my body does crave.
Well I'm just a humble corporate slave, driving myself into a corporate grave"
Corporate Slave, SNOG
|
|
|
|
|
Try googling for xbase. IIRC it can handle FoxPro files also.
|
|
|
|
|
okay thanks chaps, but I really would like to code this myself have you any idea as to why my approach doesn't work ?
cheers
Pete Kane
|
|
|
|
|
pk_fox wrote:
but I really would like to code this myself
OK, you want to do it as an excercise. I got the impression you were looking for a solution to a problem.
I still think you should have a look at the xbase code since 1) IIRC it can handle FoxPro files and 2) since the source is available, and much documentation about these dBase derived formats is also included, you can from there figure it out yourself.
|
|
|
|
|
Hi,
I'm doing an application that first checks the OS installed in the machine where it is run. If the OS is Windows 2000, the porgram does a number of checks with iphlpapi, which do not work in Windows 9x. If the Os is Win9x, it displays some information.
The application has the following structure:
if (OS is Win2K)
{
... checks with iphlpapi
}
else
{
... displays some information
}
Now, the application fails in Win9x, and I don't understand why. The functions in the first part of the if are not executed, so why does it give an error?
The curious thing is that if do this:
if (OS is Win2K)
{
/*
... checks with iphlpapi
*/
}
else
{
... displays some information
}
(I comment all the first part of the if)
It DOES work in win9x, perfectly. So the part that is giving me an error is the part that si not even executed in Win9x. I don't get it!
Any ideas about this?
Thanks a lot.
F
|
|
|
|
|
Ouch.
Without much info, there is probably something in the commented out section that has a side effect, even though it never is executed. The side effect might be something like loading another DLL, and that somehow causes a problem with the Win9x processing.
Have you tried switching things around so that you test for OS is NOT Win2000, rather than OS IS Win2000? This doesn't cancel a side effect of loading a DLL, but it may indicate something else.
Just a few guesses, as you haven't given much to go on.
Dave
"You can say that again." -- Dept. of Redundancy Dept.
|
|
|
|
|
Not only you don't have to call the W2k-only functions, also you cannot link them: When the program uses some Win32 function, it is linking against a so called import .lib, which loads the corresponging DLL and arranges everything so that when the time comes to call the function, everything works. The problem with a W2k-only function is that the import library will try to load it even if the program never calls it!
You have two options:- Do the loading yourself, as in this example with
TryEnterCriticalSection :
BOOL (WINAPI * pTryEnterCriticalSection)(LPCRITICAL_SECTION lpCriticalSection);
HMODULE hKernel32;
void LoadW2kFunctions()
{
hKernel32=LoadLibrary("KERNEL32");
(FARPROC&)pTryEnterCriticalSection=GetProcAddress(hKernel32,"TryEnterCriticalSection");
}
...
if(OS is W2k){
LoadW2kFunctions
}
...
if(OS is W2k){
pTryEnterCriticalSection(...);
}
else{
...
} This is hard work, you'll probably find some problems along the way. - In VC++ 7.0, there's an option called delayed loading which loads DLLs the first time thery're used. If you have this compiler, this is surely the fastest way to get your problem solved.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín, aprecio tu respuesta. Estoy trabajando con VC++ 6, pero creo que puedo conseguir instalar la versión 7.
Te mantendré informado de mis progresos en este respecto.
Thanks a lot.
n
|
|
|
|
|
Se me ha ocurrido otra solución:
Do you think I could work wiht a try-catch block, do that if an error takes place I could detect it, and then I could detect that is the 'not supported by OS' problem and then do the information display I want to do on Win9x machineS?
Thanks for your advice.
n
|
|
|
|
|
Hello, I am getting syntax errors in this file upon compile but I can't figure out what is wrong. Can someone comment?
Thanks.
The errors are:
cinterface3.cpp(17) : error C2065: 'DWORD' : undeclared identifier
cinterface3.cpp(17) : error C2146: syntax error : missing ';' before identifier 'tid'
cinterface3.cpp(17) : error C2065: 'tid' : undeclared identifier
cinterface3.cpp(19) : error C2065: 'HANDLE' : undeclared identifier
cinterface3.cpp(19) : error C2146: syntax error : missing ';' before identifier 'hThread'
cinterface3.cpp(19) : error C2065: 'hThread' : undeclared identifier
cinterface3.cpp(21) : error C2065: 'CreateThread' : undeclared identifier
cinterface3.cpp(23) : error C2146: syntax error : missing ';' before identifier 'CloseHandle'
cinterface3.cpp(23) : error C2065: 'CloseHandle' : undeclared identifier
#include <stdio.h>
#include <string.h>
struct io {
char time[10];
int start;
};
struct io cio;
extern "C" __declspec(dllimport) void _stdcall FTREND3
( long * );
void main (void)
{
DWORD tid, cio;
HANDLE hThread;
hThread = CreateThread(NULL, 0, FTREND3, &cio, 0, &tid)
CloseHandle(hThread);
printf("In c after fortran thread started\n\n");
printf("string = %s\n",cio.time);
}
|
|
|
|
|
#include <windows.h>
is probably missing.
|
|
|
|
|
sorry... the special quote characters are not displayed on this website:
#include "windows.h"
is prbably missing
|
|
|
|
|
I am almost willing to bet that it is because you haven't specified /Mt or /Mtd, ( or whichever it is for your version of VC ), to enable multithreading. The Microsoft headers have a nifty ( not ) set of defines which undef the multithreading functions if the _MT define, ( which comes through the /M... compiler switches ), aren't set.
-=jarl=-
|
|
|
|
|
Thanks all.
The include windows.h cleaned up many errors.
|
|
|
|
|
Hy everybody!
I made an GUI Dll, and I found a problem...
- When I made my Dialog modeless, the default button doesn't work. It only works if the Dialog is Modal
Why?
cheers!
Ricky
|
|
|
|
|
I need to be able to keep all of the controls of a dialog ( for resize purpose )in a list/vector, ... ; so I use GetDlgItem with the controls ID to retrieve the CWnd of each control; but MSDN says that the pointer is temporary.
I don't want to keep a member variable for each control of the dialog; but this is working and might be a simpler solution.
Is there another way to do this ?
Max.
|
|
|
|
|
I think the pointer is temporary because controls can be created and destroyed dynamically. I think you will be fine to leave it the way that it is.
For safety, you may want to make the OnDestroy handler remove the point for that control from the parent dialog class.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|