|
i have a problem with irda/connect: the code is
if (connect (sock, (struct sockaddr *)&address,
sizeof (SOCKADDR_IRDA)) == SOCKET_ERROR)
{
wsaError = WSAGetLastError();
}
wsaError returns WSAEINVAL;
There is some link that help me!
|
|
|
|
|
Anonymous wrote:
There is some link that help me!
That is correct, and I can't for my life understand why you haven't used it yourself!
|
|
|
|
|
I have an application with an MDI Doc/View architecture, and I want to call MDITile() every time I open a new unique document, so that it automatically tiles all documents.
Problem is, when I call it from within CMainFrame::PreCreateWindow, i keep getting assertion errors (wrong object type). Also, having problems getting a handle to CMDIFrameWnd() outside of my mainframe.cpp file.
Help! When/where/how should I be calling MDITile() ??
|
|
|
|
|
FlyingWren wrote:
when I call it from within CMainFrame::PreCreateWindow, i keep getting assertion errors
You can't call it from CMainFrame::PreCreateWindow. The application windows are not created yet, that's probably cause of the assertion.
FlyingWren wrote:
Also, having problems getting a handle to CMDIFrameWnd()
AfxGetMainWnd() returns the CMainFrame pointer for MDI application.
Pavel
Sonork 100.15206
|
|
|
|
|
FlyingWren wrote:
I have an application with an MDI Doc/View architecture, and I want to call MDITile() every time I open a new unique document, so that it automatically tiles all documents.
Problem is, when I call it from within CMainFrame::PreCreateWindow, i keep getting assertion errors (wrong object type). Also, having problems getting a handle to CMDIFrameWnd() outside of my mainframe.cpp file.
CMainFrame::PreCreateWindow() is way too early. Have a look at doing it in CChildFrame::ActivateFrame()
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Hello,
I am trying to develop a function that accepts one pointer to a character array, and takes out all of the white spaces in the array leaving only the characters in the same sequential order. However, I want to accomplish this by only using the one pointer passed to the function. I know this is probably not the best way to accomplish this but I know it can be done somehow. Any suggestions and help would be greatly appreciated. Thanx
I Am trying to figure out how to do this by not declaring another pointer, or variable of any type in the function.
This just seems kinda more interesting to me.
codefun
|
|
|
|
|
Homework?
void skipspace(char* txt)
{
char *to = txt;
char *from = txt;
do
{
while(isspace(*from)) from++;
if(to!=from) *to = *from;
to++;
from++;
}
while(*to);
}
Pavel
Sonork 100.15206
|
|
|
|
|
Intellect559 wrote:
However, I want to accomplish this by only using the one pointer passed to the function. I know this is probably not the best way to accomplish this but I know it can be done somehow. Any suggestions and help would be greatly appreciated. Thanx
Just use a loop to sequentially search through the array, placing the non-whitespace characters into a temporary arry of the same size as the one passed to it... then just copy the temp array back over the original one. Shoudl do the job for you
Regards,
Brian Dela
|
|
|
|
|
And allocate an extra array just for that job?
What about something like
foo(char *s)
{
char *mid = s;
while (*(s++) != ' ')
{
if (s == '\0')
{
break;
}
*(++mid) = s;
}
}
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Duh brian... sorry. My brain has been on a go slow for the last 3 months, or so
Regards,
Brian Dela
|
|
|
|
|
Assuming you function is
fn(char* p)
just get a local pointer that you initialize to "p", and whenever you reach a non-space you
*p++ = *local++;
and whenever it is a space you just increment "local".
|
|
|
|
|
Hello,
I want to resize an edit control in my Cdialog derived class :
void CMyDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
GetDlgItem(IDC_EDIT_TEXT) -> SetWindowPos(NULL, 0, 0, cx, cy, SWP_NOMOVE | SWP_NOOWNERZORDER);
}
But my app crash... why ??
|
|
|
|
|
The OnSize is first called, before the dialog window is displayed and GetDlgItem returns NULL.
Pavel
Sonork 100.15206
|
|
|
|
|
Hello, I need to be notified somehow when the mouse hovers above
a button on my toolbar and I need to know which button it hovers
above. I was under the impression that if I created the toolbar
with the style TBSTYLE_REGISTERDROP I could catch TBN_GETOBJECT, but
it never gets generated, it seems. What is the most straightforward way
to accomplish this?
// William Payne
|
|
|
|
|
catch the WM_MOUSEMOVE message for your button:
LRESULT CALLBACK WindowProc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
);
|
|
|
|
|
In Some websites I get this message(box), How do I get rid of this?!
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
IE->Tools->Internet Options->Advanced->Browsing->Disable script debugging should help.
Pavel
Sonork 100.15206
|
|
|
|
|
When I loaded the ".dsw" file into the VC++ IDE, a message popped up saying that VC++ was unable to load the ClassView information file.
Yes, there was no ClassView information shown after the loading took place, though ResourceView and FileView were present!
Might anyone know why this occurred, and how I may get back ClassView? I did try reloading the program several times, but each time it was the same.
Thanks!
William
|
|
|
|
|
I'm assuming you're referring to VS6.
Usually this problem is caused by your classview file (.ncb) being read-only, check for this first of all. Otherwise delete any existing .ncb file and restart VS, it will then rebuild the classview file from scratch.
Hope this helps,
Jason.
modified 10-Jul-19 21:02pm.
|
|
|
|
|
This can also happen when you have more than one instance of the IDE openning the same workspace.
Gary R. Wheeler
|
|
|
|
|
You have an interesting point there, because while there are two distinct projects being worked on (residing in two separate directories, with different names) the files both projects have, are about 99% the same.
Both projects were loaded into their own respective workspace, but only the first one showed the ClassView. The second project with its different name, located in a different directory and loaded into its own workspace, did not show its ClassView.
William
|
|
|
|
|
if (connect (sock, (struct sockaddr *)&address,
sizeof (SOCKADDR_IRDA)) == SOCKET_ERROR)
{
wsaError = WSAGetLastError();
}
wsaError returns WSAEINVAL;
Why? Which error?
|
|
|
|
|
In VC projects there is an option to choose Runtime library ,
Project-Settings,
C++ Tab
Category:Code generation
Use of runtime library: Multithreaded DLL.
I Want to understand about this option, what difference would it make on my application if I make it Single thereaded.
Thanks in advance.
Abhishek Narula
|
|
|
|
|
You will not be able to safely create multiple threads.
It uses libraries that are multi-thread safe when you select the multithreaded libraries, as well as adding functions that are only specifically used in multi-threaded applications.
The difference between the multi-threaded and single-threaded libraries is that multi-threaded functions serialize access to global data to prevent common problems that occur in MT apps. If you try to use a single threaded function or library in a MT environment, undefined behaviors could possibly occur.
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!
|
|
|
|
|
I want to write a NT Services with ATL.Can anybody tell me a link or tutorial about NT Services with ATL?
Thanks
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|