|
Hello,
i have some problem with socket. My client is iPAQ and server a computer.
The client send some bitmap with IRDA;the code is
DEVICELIST devList;
int sizesock;
int count;
HANDLE HandleFile;
int byteread;
int i;
int len=sizeof(devList);
char buffer[4096];
TCHAR szerror[100];
SOCKADDR_IRDA address={AF_IRDA, 0,0,0,0, "c"};
SOCKADDR_IRDA d;
SOCKET sock;
SOCKET e;
DWORD WrittenNum;
if((sock=socket(AF_IRDA, SOCK_STREAM, 0))==INVALID_SOCKET)
{
wsprintf(szerror, TEXT("Errore"));
MessageBox(NULL, szerror, MB_OK);
return;
}
devList.numDevice=0;
while((devList.numDevice==0)&&(count<=NUMETENT))
{
getsockopt(sock, SOL_IRLMP, IRLMP_ENUMDEVICES,(char*)&devList, &len);
count++;
}
for(i=0; i<4;i++)
{
address.irdaDeviceID[i]=devList.Device[0].irdaDeviceID[i];
}
connect(sock, (struct sockaddr *)&address, sizeof(SOCKADDR_IRDA));
but i don't finish.
Help me?
Luca
|
|
|
|
|
If i want to send and receive bitmap, how i can do?
|
|
|
|
|
In Visual Basic 6, I want to make a mediaplayer executable using MS control: Mediaplayer to play mpg files.
I've got a problem if I opened the same movie object twice without knowing whether or not a same application was playing at the moment.
How can I determine the status of a mediaplayer obect so that when I play it for the second time, the first one, if still playing, can be stopped and closed?
I have tried to mediaplayer.stop and end the application when either form and mediaplayer losts its focus. It is supposed to work like this: when I run/play a second movie, the first one may lost focus and thus being stopped and closed. But it failed, i.e when I click the application twice, the second one will pop up and run, however, the first movie will be running simutaneously at background.
Any comments and suggestions?
Thanks in advance!
DJ
|
|
|
|
|
Ask this in the VB forum!!!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I understand but I need it quite urgently.
Sorry for the inconveniece caused.
DJ
|
|
|
|
|
In creating a dialog indirectly, i have to specify the DLGTEMPLATE.x, y, cx, cy in dialog unit. However, I only have the pixel positions at hand. How can i do conversion on it before the dialog is created ?
|
|
|
|
|
How about using:
MapDialogRect() and GetDialogBaseUnits() (see MSDN)??
You create the dialog but before you make it visible use these functions to make any changes to the dialog you need. If you must get these figures before you create the dialog and are not using the system font then you need to get the text metrics of the font you wish to use and do the conversion yourself.
hope this helps.
Adam.
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
I do this in my constructor:
class CMyClass
public:
CMyClass() throw CMyException()
{
...
throw CMyException(234);
}
...
the compiler says "Cannot convert from int to CMyException"
daah!?!?!??!!?!?
How do I implement exceptions in my class!?!?!?!
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
How are you defining CMyException ? Does the class have a constructor accepting an int as its argument?
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Yes!
Here is the actual class:
class CSocketException
{
public:
CSocketException(int excID): m_ExceptionID(excID)
{
}
~CSocketException(){};
int GetID(){return m_ExceptionID;};
private:
int m_ExceptionID;
};
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
VC++ is not standard-compliant in the area of declaring exceptions thrown by a function. Change your code to:
class CMyClass{
public:
CMyClass() throw ()
{
...
throw CMyException(234);
}
... or simply omit the throw() part.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Can I put throw() in a declaration too?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Yes.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello everyone!
I'm facing a problem with the CRichEditCtrl::LineScroll member function.
I've created a RichEditCtrl (without using the ES_CENTER or ES_RIGHT styles) yet when I call the member function with the second parameter which corresponds to the number of characters to scroll horizontally in the ctrl, nothing happens.
If anyone has a suggestion on what might be wrong it would help alot!!
Thanks!
|
|
|
|
|
I've a CFormView derived class CMyView, which contains a member CTabView derived from CTabCtrl, and CTabView contains several CDialog derived classes.
For DoDataExchange(pDX) in CMyView. It is reasonable that I call DoDataExchange(pDX) of the child CTabView and in turns call DoDataExchange(pDX) of CMyDialogs.
However, it raised assertion error, as i traced back, GetDlgItem() couldn't get the dialog item.
It seems I should create another CDataExchange to do DDX for each child, but i don't know how to create CDataExchange instance myself.
|
|
|
|
|
Just call COtherDialog::UpdateData(TRUE) instead. Basically, UpdateData creates CDataExchange instance and calls DoDataExchange when bSaveAndValidate is TRUE.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
How can I change the caption of my window (CMainFrame) ?
--
Nice greets, Daniel.
|
|
|
|
|
The CMainFrame caption is build from IDR_MAINFRAME resource string and a string describing the active document. You can change the IDR_MAINFRAME string in resources.
If you want to change the caption at runtime, override the OnUpdateFrameTitle virtual method of CMainFrame or your CMDIChildFrame derived class (for the active document caption, if you are building MDI application).
Also SetWindowText method sets the caption immediatelly, but this will be sooner or later set back to default caption.
Pavel
Sonork 100.15206
|
|
|
|
|
I have a CPropertySheet object that has four CPropertyPages attached to it. How can I have the tab control of one page display as bold text and the others as normal text? Also, can this be changed dynamically at any time or can it only be done when my dialog is initialized?
Thanks!
|
|
|
|
|
i think the only way to do this is to make the tab control within the propertysheet owner draw.
check out Ownerdraw Tab Controls - Borders and All
and if you've got any further queries i'd be happy to help.
|
|
|
|
|
Hi
i'm trying to get started coding embedded stuff
downlaoded the sdk's etc
has anyone else done any ce coding so i may as a Q or 2?
regards
Bryce
|
|
|
|
|
Hi there,
Is there any way to show a bitmap when the button is disabled by CButtonST ??
If not, how can i add it to CButtonST ??
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I assume CButtonST is a class on CP - why don't you ask on the article, so the author gets an email letting him/her know you have a question ?
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
|
|
|
|
|
Because the situation has occurred several times, I'm beginning to wonder whether there might be a way I can stop it from recurring in the future.
Here's what I'm talking about. In Tools->Options->Directories, under the "Show Directories for" dropdown box for "Include", sometimes the application I'd be working on would fail to compile due to an error typical to the one listed below:
=================================
Deleting intermediate files and output files for project 'MyPad - Win32 Debug'.
--------------------Configuration: MyPad - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
c:\program files\microsoft sdk\include\exdisp.h(1118) : error C2061: syntax error : identifier 'SHANDLE_PTR'
c:\program files\microsoft sdk\include\exdisp.h(1633) : error C2061: syntax error : identifier 'SHANDLE_PTR'
Error executing cl.exe.
MyPad.exe - 2 error(s), 0 warning(s)
=================================
By rearranging the order of the entries in the directory listbox, ninety-nine percent of the times, the errors would go away and a subsequent clean compile and linkage would occur.
Clearly, VC++ has a specific way in which it wants those entries to be.
My contention is, "Should it really matter that the order of the entries be more important than the actual presence of the entry itself?"
To me, I would think, having the entry present (to begin with) would be more important than whether it is first in line, or second in line, or third (etc.).
Is there something I can do that will stop these kind of occurrences from happening?
Thanks!!
William
|
|
|
|
|
Think about when you have two headers files with the same name in two different directories, which header file should be used. That is why the precedence is taken into account.
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!
|
|
|
|