|
There are some articles about Ole DB in CP.I've not read them but maybe they help you.
http://codeproject.com/database/#OLE%20DB
Mazy
"The more I search, the more my need
For you,
The more I bless, the more I bleed
For you."The Outlaw Torn-Metallica
|
|
|
|
|
Hi Guys,
I have a Win32 Conole application that simply continously displays a 'results' file. and at the bottom of console I give the user option to enter X to exit.
I want the console window to totally disappear/shutdown when the user enters 'X'
I don't want to see the 'Press any key to continue' prompt
If I use 'exit' or 'return' in my code I still get the 'Press any key to continue' prompt.
How can I get my app to just exit with out gettong the 'any key' prompt???
Cheers
Zed's dead, baby. Zed's dead.
|
|
|
|
|
Sounds like you are calling the console app from a batch file. If so, you need to change the batch file, not the app.
|
|
|
|
|
Checl out the FreeConsole() API
Dylan Kenneally
London, UK
|
|
|
|
|
Guess ur launching the application from Visual C++ am i right?
Papa
Murex Co.
|
|
|
|
|
I use the MS VCC+ 6.0 Compiler. After a system-crash i have
great problems, to open the project. During opening the
project uses nearly 100% of CPU an i can wait a long time.
The same by changing in the project.
What can i do?
|
|
|
|
|
After MSVC has crashed, check that it has actually closed. Sometimes you'll get one or more MSDEV.EXE processes left running, which you can kill off with Task Manager before you restart it.
It's pretty good practice to reboot your machine after a crash though.
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
You may also consider deleting the .opt, .ncb, .clw, .aps, .plg files and the Debug and Release directories. Sometimes it helps!
Best regards,
Alexandru Savescu
|
|
|
|
|
How can i get the date from a coleobj (DateTimePicker) and
convert it to a access time format (date, short, 99:99:99,0)
|
|
|
|
|
Bind it to a COleDateTime member variable in class wizard, and then you can use the GetDay(), GetMonth(), etc members. It should be fairly straightforward to convert it into access format from there
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
I need some ideas to do a project of Engineering standards in VC. Can anyone provide ideas or links ? A project with source code would be more helpful.Thanks in advance.
|
|
|
|
|
Hello,
I previously wrote the contents of an array of floats to a file, in binary, using the following;
OutputFile.write((char*)Z, sizeof(float) * n); //write n elements of array Z
Instead of an array, if Z is defined as a Vector of floats, is there an equivalent of the above. Can I obtain a pointer to the start of the vector?
Thanks,
John
|
|
|
|
|
Think I've got the answer - dereference the vector... (char*) &Z
|
|
|
|
|
John Oliver wrote:
Think I've got the answer - dereference the vector... (char*) &Z
That will be wrong.
You have to dereference the first element like &Z[0].
..this is a VB Programmers' world and we all are just visitors - Someone in a MSJ article
|
|
|
|
|
If v is the name of the vector, then &v[0] points to the underlying buffer.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
what's the difference between a vector and a one-dimensional array in C++? as far as i know, nothing.
so, this is an equivalence class:
&V[0]
&(*(V+0))
&(*(V))
V
therefore, you can use V if you want.
|
|
|
|
|
The difference is that an array is a wrapper around the data, therefore, the correct answer remains &v[0];. A vector of int's is a block of ints, the first one being at &v[0];. v has nothing to do with int's or memory, it is an instance of the vector class.
In fact, if you want a pointer to an element, you must dereference an iterator, then ask for the address, exactly as you have put it: &(*(V)). VC6 wrongly will accept the iterator as a pointer, VC7 corrects this.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
|
|
|
|
|
I am writing an application using TAPI 2.0 on Win NT4 (the other end will be Win98) to answer calls. So far I haven't made much progress
TAPI is initialised okay and a line opened successfully. I then call lineSetStatusMessages as follows:
DWORD dwLineStates = LINEDEVSTATE_CLOSE |
LINEDEVSTATE_CONNECTED | LINEDEVSTATE_DISCONNECTED |
LINEDEVSTATE_RINGING;
lRes = lineSetStatusMessages(m_hLine, dwLineStates, 0);
In my TAPI event handling thread I have the following code to handle the events of interest:
LINEMESSAGE lineMess;
long lRes = lineGetMessage(g_hLineApp, &lineMess, 0);
if(lRes < 0)
{
TRACE1(_T("lineGetMessage failed returning 0x%X\n"), lRes);
}
else
{
TRACE1(_T("Call Handle: 0x%X\t"), lineMess.hDevice);
TRACE3(_T("dwMessageID: %d\tdwParam1: 0x%X\tdwParam2: 0x%X\n"),
lineMess.dwMessageID, lineMess.dwParam1, lineMess.dwParam2);
switch(lineMess.dwMessageID)
{
case LINE_CALLSTATE :
switch(lineMess.dwParam1)
{
case LINECALLSTATE_OFFERING :
{
lRes = lineAnswer(g_hCall, NULL, 0);
TRACE1(_T("lineAnswer returned 0x%X\n"), lRes);
}
break;
case LINECALLSTATE_DISCONNECTED :
{
lRes = lineDrop(g_hCall, NULL, 0);
TRACE1(_T("lineDrop returned 0x%X\n"), lRes);
}
break;
}
break;
}
}
This produces the following trace output:
Call Handle: 0x982AE8 dwMessageID: 23 dwParam1: 0x0 dwParam2: 0x982BC0
Call Handle: 0x982BC0 dwMessageID: 2 dwParam1: 0x2 dwParam2: 0x0
lineAnswer returned 0x1
Call Handle: 0x982AE8 dwMessageID: 8 dwParam1: 0x2 dwParam2: 0x1
Call Handle: 0x0 dwMessageID: 12 dwParam1: 0x1 dwParam2: 0x0
Call Handle: 0x982BC0 dwMessageID: 2 dwParam1: 0x4 dwParam2: 0x0
Call Handle: 0x982BC0 dwMessageID: 2 dwParam1: 0x4000 dwParam2: 0x800
lineDrop returned 0x2
lineDeallocateCall returned 0x0
Call Handle: 0x982BC0 dwMessageID: 2 dwParam1: 0x1 dwParam2: 0x0
Call Handle: 0x0 dwMessageID: 12 dwParam1: 0x2 dwParam2: 0x0
Call Handle: 0x982AE8 dwMessageID: 3 dwParam1: 0x0 dwParam2: 0x0
which can be interpreted as:
dwMessageID: LINE_APPNEWCALL
dwMessageID: LINE_CALLSTATE dwParam1: LINECALLSTATE_OFFERING
lineAnswer returned 0x1
dwMessageID: LINE_LINEDEVSTATE dwParam1: LINEDEVSTATE_RINGING
dwMessageID: LINE_REPLY dwParam1: 0x1 (Request ID)
dwMessageID: LINE_CALLSTATE dwParam1: LINECALLSTATE_ACCEPTED
dwMessageID: LINE_CALLSTATE dwParam1: LINECALLSTATE_DISCONNECTED dwParam2: LINEDISCONNECTED_UNAVAIL
lineDrop returned 0x2
lineDeallocateCall returned 0x0
dwMessageID: LINE_CALLSTATE dwParam1: LINECALLSTATE_IDLE
dwMessageID: LINE_REPLY dwParam1: 0x2 (Request ID)
dwMessageID: LINE_CLOSE
As you can see. When a call is received it is answered successfully, but then the LINE_CALLSTATE changes to LINECALLSTATE_DISCONNECTED straight away. The reason code is UNAVAIL, which means it doesn't know and never will
The call is being initiated on a Win98 PC using Hyperterminal. The really frustrating part is that the initiating modem thinks it is connected. Issuing the command AT+CPAS gives a return code of 4, which means Call in Progress!
Even more frustratingly, if a carry out a call from Hyperterminal to Hyperterminal across the 2 PCs it works without problem
Any ideas where I'm going wrong? Why does it think the line has been disconnected when it hasn't?
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Are you able to establish a Dial-up connection with that modem? If not, this might shed some light on where your problem lies.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
They are actually GSM modems connected to the serial port and using the Standard Windows 9600 modem driver (if that makes a difference).
I haven't tried making a dialup connection, but they talk ok using Hyperterminal. I can even transfer a file from one to the other using Hyperterminal.
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
I always thought that when you recieved a LINECALLSTATE_OFFERING message, you needed to do the lineAccept and not lineAnswer.
What parameters are you sending to lineOpen ?
Is it using the standard UNIMODEM TSP?
Can I recommend the following samples at http://www.julmar.com/samples.htm
TCMON and PHONE are good for debugging TAPI issues.
Michael
"Eureka" is Greek for "This bath is too hot"
|
|
|
|
|
Michael P Butler wrote:
I always thought that when you recieved a LINECALLSTATE_OFFERING message, you needed to do the lineAccept and not lineAnswer.
Don't no. I'll try it, though.
Michael P Butler wrote:
What parameters are you sending to lineOpen ?
My lineOpen call is as follows:
lineOpen(g_hLineApp, m_dwDeviceID, &m_hLine,
dwAPIVersion, 0, 1, LINECALLPRIVILEGE_OWNER,
LINEMEDIAMODE_DATAMODEM, NULL);
Michael P Butler wrote:
Is it using the standard UNIMODEM TSP?
Huh??!! I have no idea Is that TAPISRV.EXE (or is it TAPISRV32.EXE? I can't remember now)
Michael P Butler wrote:
Can I recommend the following samples at http://www.julmar.com/samples.htm
Yes you can. Thanks very much
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
Michael P Butler wrote:
I always thought that when you recieved a LINECALLSTATE_OFFERING message, you needed to do the lineAccept and not lineAnswer.
I've tried that now. It accepts the call (as the name suggests), but it does not complete the connection. It continues to ring (LINE_LINEDEVSTATE messages are continually received with Param1 = LINEDEVSTATE_RINGING).
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|
|
You need to call lineAnswer when you receive the LINEDEVSTATE_RINGING. This should answer the call and give you a LINECALLSTATE_CONNECTED. (At least in theory - TAPI and modems is a trial and error kind of thing)
Michael
"Eureka" is Greek for "This bath is too hot"
|
|
|
|
|
Presumably I need to pick up the call handle when I get the LINECALLSTATE_OFFERING to use when I get the LINEDEVSTATE_RINGING (becuase hDevice for LINE_DEVSTATE is the device handle not the call handle.
The problem has not so much been answering the call, but that having answered it (using lineAnswer) I get LINECALLSTATE_DISCONNECTED straight away.
Thanks anyway, I'll give it a go.
Derek Lakin.
I wish I was what I thought I was when I wished I was what I am.
Salamander Software Ltd.
|
|
|
|