|
_wtoi
you can find it, togheter with _ttoi , the generic one, in MSDN, if you search for atoi , haven't you?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
CPallini wrote: _wtoi
How does that relate to floating-point numbers?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Sorry I was sure we were talking about atoi !!
It seems that atof has not a wide-string cousin.
Workarounds, I guess, maybe:
(1) using WideCharToMultiByte and then atof .
(2) using swscanf
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
The C runtime reference lists all the forms of functions including a table with the generic
text versions.
F1 is your friend
try _wtof
|
|
|
|
|
Hi
I want to add a com dll in my c++ project. I also post this query before and one experts suggets me to use explicit linking
and i follow the suggested steps.But now object of dll has been created but it disply exception.
i psate the code here
#import "Redemption.dll" no_namespace
HRESULT In=CoInitialize(NULL);
if ( SUCCEEDED ( In ) )
{
IRDOSession* Session=NULL;
iRDOStoresPtr ptr;
HRESULT hr =CoCreateInstance( __uuidof(RDOSession),
NULL,
CLSCTX_INPROC_SERVER,
//CLSCTX_LOCAL_SERVER,
__uuidof(IRDOSession),
(void**) &Session
);
if ( SUCCEEDED ( hr ) )
{
// Call methods using pISL here.
//Session->Logon(" ",NULL,NULL,NULL,NULL,NULL);
ptr=Session->Stores->AddPSTStore("c:\w.pst",NULL,"New");
}
Session->Release();
CoUninitialize();
}
the object is accessing all members but when called it display exception.
Plz tell what the prblem is.I got confused.
manu
|
|
|
|
|
manu_2205 wrote: ptr=Session->Stores->AddPSTStore("c:\w.pst",NULL,"New");
Try to replace the \ character with a double backslash (\\)
You should get at least a compiler warning, since escape-w isn't a valid escape character (or is it?).
Stores->AddPSTStore("c:\\w.pst",NULL,"New");
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I try Again it display exception.
Even it has a Logon() function .It also disply run time error.
I am not getting what the problem is .
When i debug the application it open .tli file and disply exception.
manu
|
|
|
|
|
I want to tell that
IRDOSession :- is a interface
RDOSession:-It is coclass
manu
|
|
|
|
|
Hi manu,
try passing BSTR or unicode strings as the parameter value.
do not pass strings like "" etc,
give some value like L"myValue".
^-^
@|@
- redCat
|
|
|
|
|
What function?Whats values of input this function and what return value?
|
|
|
|
|
hi friends,
I got a problem while using this mciSendCommand(....) function. Actually I want to play PAL video files so I used the MCI_SETVIDEO using mciSendCommand(...) function for setting it as PAL video but I am getting the error returned from that function as MCIERR_MISSING_PARAMETER
void InitialiseMCIWindow()
{
UINT ut;
MCI_GENERIC_PARMS gen;
if((c_Player=MCIWndCreate(hwndParent,AfxGetInstanceHandle(),
WS_CHILD | MCIWNDF_SHOWNAME |
MCIWNDF_SHOWMODE |
WS_VISIBLE , m_sPath))==0)
MessageBox("Error in initialise");
gen.dwCallback = MCI_DGV_SETVIDEO_ITEM | MCI_DGV_SETVIDEO_SOURCE | MCI_DGV_SETVIDEO_SRC_PAL ;//
ut = MCIWndGetDeviceID(c_Player);
MCIERROR err = mciSendCommand((MCIDEVICEID)ut,MCI_SETVIDEO,MCI_NOTIFY,(DWORD_PTR) (LPMCI_GENERIC_PARMS) &gen);
if( MCIERR_MISSING_PARAMETER == err )
MessageBox("Error Got");
// if(err == 0)
// MessageBox("Success");
// else
// MessageBox("Failed");
.............
}
Can anyone help me with this problem???
With regards
Raja Bose
|
|
|
|
|
Just a thought, does gen need to be initialised?
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
first of all i like to thank u for replying ....
Still i am getting the error message even without gen initialisation ... without gen initialisation can u tell me how to set the source video as PAL
Thank u,
With regards
Raja Bose
|
|
|
|
|
I'm not very familiar with the commands, but according to MSDN http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_mcisendcommand.asp[^]
the command looks like this:
MCIERROR mciSendCommand(
MCIDEVICEID IDDevice,
UINT uMsg,
DWORD fdwCommand,
DWORD_PTR dwParam
);
where dwParam is a pointer to a structure that contains parameters for the command message.
So the command itself is contained in the struct.
Try to find a sample and start from there. Good luck.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
gen.dwCallback should be the HWND of the window to receive the notification message when the
command completes since you're using MCI_NOTIFY.
the MCI_DGV_xxx flags should be combined (OR'd) with MCI_NOTIFY in the third param to
mciSendCommand().
Mark;
|
|
|
|
|
first of all i appreciate your kind help
Thank u very much for replying ..... Its working fine ....
Thanks a lot............
With regards
-- modified at 6:54 Thursday 4th January, 2007
Raja Bose
|
|
|
|
|
You're very welcome
|
|
|
|
|
Did you set dwValue member of the structure you used?
|
|
|
|
|
hello,
I have problem with plus. i couldnt get right total number!
And also I ld to know how to store all list of total number. coz i ld to compare them wh is biggest and smallest.
int n = 0;
cin>>n;
for ( i = 0; i < 3*n; ) {
cout << "Hand #" << n<< '\n';
for ( int j = 0; i < 52 && j < 3; i++, j++ ){
cout << deck[i].suit << deck[i].face <<" ";
deck[i].value++;
}
cout<<deck[i].value<<endl<<endl;
}
sample result:
S5 HK H6 total 6
|
|
|
|
|
davvid wrote: for ( int j = 0; i < 52 && j < 3; i++, j++ ){ cout << deck[i].suit << deck[i].face <<" "; deck[i].value++; }
I don't see how this can work. j will go up to 52, because it increases with i. deck[i].value is incremented, but never used in any way. It looks like it's all a mess.
I also don't see how this code relates to your question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thank for ur reply anyway..
now i can print out total num in the right way.
But i still have problem with how to store all total number of several player.
coz I dont know really the size of array or other.It is depended on the amount of player that user want to play.
here is code:
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <string>
struct {
char suit;
std::string face;
int value;
}deck[52];
struct {
const char *face;
int value;
}cardValues[] = {
{"2", 2},{"3", 3},{"4", 4},
{"5", 5},{"6", 6},{"7", 7},
{"8", 8},{"9", 9},{"10", 10},
{"J", 13},{"Q", 12},{"K", 11},
{"A", 1}
};
const char cardSuits[] = {'D','C','H','S'};
int main()
{
using namespace std;
int ur, i = 0;
for ( int suit = 0; suit < 4; suit++ ){
for( int face = 0; face < 13; face++ ){
deck[i].face = cardValues[face].face;
deck[i].value = cardValues[face].value;
deck[i].suit = cardSuits[suit];
++i;
}
}
srand ( (unsigned int)time(0));
random_shuffle( deck, deck + 52 );
int n=0;
cin>>n;
for ( i = 0; i < 3*n; ) {
int urtotal=0;
cout << "Hand #" << n<< '\n';
for ( int j = 0; i < 52 && j < 3; i++, j++ ){
cout << deck[i].suit << deck[i].face <<" ";
urtotal+=deck[i].value;
}
cout<<urtotal<<endl<<endl;
}
return 0;
}
|
|
|
|
|
davvid wrote: coz I dont know really the size of array or other.It is depended on the amount of player that user want to play.
You have two options
1 - use vector instead of an array ( better )
2 - set a maximum possible number of players, assign the arrays and then have a variable to say how many of those players are in use.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi everyone,
may i know whether custom control with the base class of generic CWnd can use CScrollView? If yes how do i achieve this?
Any help is much appreciated.
|
|
|
|
|
What exactly is your question?
Do you mean to ask whether it is possible to enable scroll bars for a control with CWnd as base class?
If got the question right , answer is YES.
haribabu
|
|
|
|
|
Possible, yes, but not exactly easy. All CView-derived classes expect a CDocument class to interact with. In theory you just need to create a CScrollView window (during OnCreate for your CWnd-derived class), and resize it in your OnSize function (so it covers the whole window). But as I said, this is just "in theory". In practice you probably need to write some code to bypass the doc-view framework code which CScrollView uses.
Hope this helps,
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|