|
Your program got lost probably and jumped randomly somewhere into memory. Maybe a stack was damaged before returning from a function.
Pavel
Sonork 100.15206
|
|
|
|
|
Any idea how to fix that?
Thanks
|
|
|
|
|
Hi dear,
How can I split a MPEG file into two or several small files or merge two or several MPEG files to one file?
What about DAT file?
Thank you.
|
|
|
|
|
I know there is a program which will patch it for VS6, but has one been released for .NET?
|
|
|
|
|
Why bother? From a command prompt you can yourself start MSDev.exe in low priority. Just type "start /?" and there you go.
|
|
|
|
|
Maybe he just want the compiler/linker etc to run at low priority, but the IDE should remain as responsive as possible...
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
newbie beware,
how could i convert this CString for an encryp routine?
CString tm;
tm = "Hello";
i've tried this, and everything else i could think of:
LPTSTR lpsz = new TCHAR[tm.GetLength()+1];
_tcscpy(lpsz, tm);
TCHAR HelloCrypt[] = lpsz;
i get, "can't convert char* too char[]"
any helps really appreciated.
shotgun
|
|
|
|
|
shotgun wrote:
TCHAR HelloCrypt[] = lpsz;
You can't assign a pointer to an array.
Should be:
LPTSTR HelloCrypt = lpsz;
TCHAR HelloCrypt[] = "Hello" is possible, because it's constant known at compile time.
It's not VB, at runtime you must create arrays of unknown size using new.
Pavel
Sonork 100.15206
|
|
|
|
|
figured it out
changed
TCHAR HelloCrypt[] = lpsz;
to
TCHAR *HelloCrypt = lpsz;
is there a better way or is this correct?
shotgun
|
|
|
|
|
If the input parameter of your routine is constant, you can pass directly the CString variable, CString has an LPCTSTR() operator defined.
If your routine need to write into the string data, you can use CString::GetBuffer/ReleaseBuffer methods.
Pavel
Sonork 100.15206
|
|
|
|
|
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
);
|
|
|
|