|
Hi there
I am working on a application that is supposed to create a dial up connection in order to connect two computers using the serial port (direct connection using the serial port). I can create the entry no problem but the problem i am running into is that it will not attach the serial port to it (by the way i am using RAS API)
I am setting the device type to serial but the com port is not attached to the connection created.
If i try to create the same connection using the wizard that is provided with Win XP than it gives me the option to select the serial port as a means of communication. Once i create this connection and i run my program i get the desired output so it looks like the COM ports need to be configured for RAS. Is there any way to do that programatically or run a script?
Any help will be greately appreciated!!!
<br />
<br />
<br />
LPRASENTRY lpRasEntry = NULL;<br />
DWORD cb = sizeof(RASENTRY);<br />
DWORD dwRet;<br />
DWORD dwBufferSize = 0;<br />
<br />
<br />
<br />
RasGetEntryProperties(NULL, "", NULL, &dwBufferSize, NULL, NULL);<br />
if(dwBufferSize == 0)<br />
return FALSE;<br />
<br />
lpRasEntry = (LPRASENTRY)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwBufferSize);<br />
if (lpRasEntry == NULL)<br />
return FALSE;<br />
<br />
lpRasEntry->dwSize = dwBufferSize;<br />
lpRasEntry->dwfOptions = RasEntry.dwfOptions; <br />
lpRasEntry->dwfNetProtocols = RASNP_Ip;<br />
lpRasEntry->dwFramingProtocol = RASFP_Ppp;<br />
lpRasEntry->dwType = RASET_Direct;<br />
strcpy(lpRasEntry->szDeviceType, RASDT_Serial); <br />
<br />
<br />
strcpy(lpRasEntry->szDeviceName, ports[0].name);<br />
dwRet = RasSetEntryProperties(NULL, strEntryName,lpRasEntry, dwBufferSize, NULL, 0);<br />
<br />
HeapFree(GetProcessHeap(), 0, (LPVOID)lpRasEntry);<br />
|
|
|
|
|
Hi All,
I am using (Visual C++ 1.52 IDE )for my MFC Application Project. I am working on an existing code base where the no of lines is around 100,000, spread across different header and cpp files. when i was trying to add a new function declaration for an existing class in a header file and function implementation in the .cpp file i am getting an error as given below
: fatal error C1001: internal compiler error
(compiler file 'msc3.cpp', line 429)
CL returned error code 2.
in another .cpp file.
This problems also occurs when i try to add parameters to the existing function in an existing class
heap size is 1024 declared in .def file and i have set my stack size as 8500
Pls let me know if any one has solution to this problem
Thanks in advance
Regards
Senthil.
|
|
|
|
|
See if MSDN article Q149786 is of any help.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Hi
I am using a rih edit control in my SDK app. So when i was executing the app i got the "Cannot find window class" error when i tried to call CreateDialog(..).
So i did the following
INITCOMMONCONTROLSEX init;
memset(&init, 0, sizeof(init));
init.dwSize = sizeof(INITCOMMONCONTROLSEX);
init.dwICC = ICC_STANDARD_CLASSES;
InitCommonControlsEx(&init);
Now i get an error that 'ICC_STANDARD_CLASSES' : undeclared identifier even when commctrl.h and comctl32.lib are properly used.
|
|
|
|
|
Per MSDN, ICC_STANDARD_CLASSES is not a valid option.
Prior to creating the control, I think you might need to call LoadLibrary("riched20.dll") .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
The rich edit control is initialized differently than other controls. You need to load either riched32.dll or riched20.dll in your app's init code, depending on which rich edit version you need.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|
|
Hi all,
Can we declare constructor in private section?
Regards
Rajesh
rajesh
|
|
|
|
|
Yes you can. But if you want to create an object of that class, you will need a public static member function in the class to create the object for you.
« Superman »
|
|
|
|
|
If I want to create an object of that class whose constructor is private and dont want a static member function to create an object then?
http://www.priyank.in/
|
|
|
|
|
you can create a factory class and declare it as a friend of your class. what exactly are you trying to achieve?
|
|
|
|
|
Trying to achieve nothing. Just finding out the answers, these questions are asked generally everywhere in interviews. Can you do that without a friend class also?
http://www.priyank.in/
|
|
|
|
|
the purpose of private constructors is to make it impossible for clients to call them as they wish. 2 ways to do it should be quite enough, it wouldn't make sense to make them private and provide ten other ways to call them.
|
|
|
|
|
yes you can (why couldn't you ?), but the only reason you might want to do this is to let it do some common initializations ; then you could call it from another constructor of the same class...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hello..
I am using MCI for recording sound.. I am using the sample code given in MSDN for recording.. This allows me to record sound only for specified amount of time.. I want to generalise it so that, recording stops when i click on the stop button..
At present what i am doing is as follows:
void CCNPhoneAdapterDlg::OnRecord()
{
RecordWaveFile(10000);
}
DWORD CCNPhoneAdapterDlg::RecordWaveFile(DWORD dwMilliSeconds)
{
// Begin recording and record for the specified number of
// milliseconds. Wait for recording to complete before continuing.
// Assume the default time format for the waveform-audio device
// (milliseconds).
mciRecordParms.dwTo = dwMilliSeconds;
if (dwReturn = mciSendCommand(wDeviceID, MCI_RECORD,
MCI_TO | MCI_WAIT, (DWORD)(LPVOID) &mciRecordParms))
{
mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
return (dwReturn);
}
// Save the recording to a file named TEMPFILE.WAV. Wait for
// the operation to complete before continuing.
mciSaveParms.lpfilename = "tempfile.wav";
if (dwReturn = mciSendCommand(wDeviceID, MCI_SAVE,
MCI_SAVE_FILE | MCI_WAIT, (DWORD)(LPVOID) &mciSaveParms))
{
mciSendCommand(wDeviceID, MCI_CLOSE, 0, NULL);
return (dwReturn);
}
return (0L);
}
................
Also i want to allow the user to specify the location and file name to store the recorded sound.
Can anyone help me?
Regards
Pallavi
|
|
|
|
|
Friends,
I've made an application which is automating MS-Word. I run MS-WORD from my application and my application receives events happening in that instance of MS-Word.
I want to detect keyboard events in that instance of MS word inside my application. Actually i want user to type some string in Word and press some key like Ctrl-A. As such i want MS-Word no notify my application. Is it possible with automation ?? If not then what is the solution.
Imtiaz
|
|
|
|
|
like
image link:
http://explorer.10169.net/myquestion.jpg
please help me!
How are you,every one
|
|
|
|
|
if the button is not on border (NC area), just move it to there by MoveWindow(). otherwise, u need to draw NC area urself to prevent the button from being painted (covered) by default NC drawing.
includeh10
|
|
|
|
|
I am using Visual C++ 6.0 MFC.
My database in SQL SERVER 2000
How can i Execute a data manipulation query(Delete, insert,update) with OLE DB data access ?
We use OLE DB PROVIDER or CONSUMER ?
And How to do it
I am a beginer
|
|
|
|
|
See if this helps u, do some R&D
//include sql.h and sqlext.h
char * strDSN="ICC";
char * strUser="square";
char * strPass="xyz";
char * strSQL = "Select * from INTRA_PMNS";
char * szPMN;
float fVersionNo;
char * szDestinationPath;
szPMN = new char[6];
szDestinationPath = new char[255];
SQLHENV hEnv;
SQLHDBC hDBC;
SQLHSTMT hSTMT;
int iResult;
iResult=SQLAllocHandle(SQL_HANDLE_ENV, NULL, &hEnv);
if(iResult == SQL_SUCCESS || iResult == SQL_SUCCESS_WITH_INFO)
{
iResult = SQLSetEnvAttr(hEnv,SQL_ATTR_ODBC_VERSION,(SQLPOINTER)SQL_OV_ODBC3,SQL_IS_INTEGER);
if(iResult == SQL_SUCCESS || iResult == SQL_SUCCESS_WITH_INFO)
{
iResult=SQLAllocHandle(SQL_HANDLE_DBC, hEnv, &hDBC);
if(iResult == SQL_SUCCESS || iResult == SQL_SUCCESS_WITH_INFO)
{
iResult = SQLConnect(hDBC,(SQLCHAR*)strDSN,SQL_NTS,(SQLCHAR*)strUser,SQL_NTS,(SQLCHAR*)strPass,SQL_NTS);
if(iResult == SQL_SUCCESS || iResult == SQL_SUCCESS_WITH_INFO)
{
iResult=SQLAllocHandle(SQL_HANDLE_STMT, hDBC, &hSTMT);
if(iResult == SQL_SUCCESS || iResult == SQL_SUCCESS_WITH_INFO)
{
iResult = SQLExecDirect(hSTMT,(SQLCHAR *)strSQL,SQL_NTS);
if(iResult == SQL_SUCCESS || iResult == SQL_SUCCESS_WITH_INFO)
{
iResult = SQLFetch(hSTMT);
if(iResult == SQL_SUCCESS || iResult == SQL_SUCCESS_WITH_INFO)
{
SQLINTEGER ret=-1;
{
SQLGetData(hSTMT, 1, SQL_C_CHAR, szPMN, 6, &ret);
SQLGetData(hSTMT, 2, SQL_C_FLOAT, &fVersionNo, 5, &ret);
SQLGetData(hSTMT, 3, SQL_C_CHAR, szDestinationPath, 255, &ret);
}
}
}
}
}
}
}
}
Regards
|
|
|
|
|
I created a modal dialog box which is a third level child.
I override the CDialog DoModal function and made the first level child as the owner of this modal dialog, so that this dialog will be modal only up to first level. Hence the main dialog can be activated. Before main dialog is getting destroyed, I'm destroying all the child dialogs.
While modal dialog is displaying, if I destroy the main dialog, I'm getting assertion. The problem is modal loop is still valid.
I called the function EndModalLoop() before destroying the dialog window, still the problem exist.
How to stop/exit modal loop ?
|
|
|
|
|
|
EndDilaog() also closes the dialog window but not stop the modal loop.
The combination of EndModalState() and EndModalLoop(ID_CANCEL)will solve this issue.
Is this right way of handling this problem ?
Is any other way we can solve this issue ?
|
|
|
|
|
I am writing a smartcard reader driver. Whenever I call any function of smclib, the driver does not loads, not even DriverEntry function is called! I am calling SmartcardInitialize , and all parameters are
correctly initialized. System returns error mesage 2 "The System cannot find the file specified!". I have tried the same driver on Windows XP and Windows 2000, but problem remains same. Can any one tell me what does this error message means, and how to fix it?
ARSALAN MALIK
|
|
|
|
|
Hi all..I would like to store the information regarding the toolbars in an xml file..Can any one help me to proceed further.
|
|
|
|
|