|
for some uni work i'm doin i'm tryin to make it so that u login on a html page, and then for it to open a new html page using the login details. The problem is that i don't know how to get C++ to take in the details and output the html page using login details. Don't know whether thats worded properly but any help would be much appreciated.
|
|
|
|
|
I need a routine to compress wave files into speex raw format (preferably without the Ogg wrapper) and another to decompress them back to wave files. I'll be putting the the raw speex data into my own database structure, so I'd rather not mess with the Ogg. Has anyone worked with Speex that can tell me if I'm barking up the right or wrong tree?
|
|
|
|
|
On regard http://www.codeproject.com/script/comments/forums.asp?msg=1994839&forumid=1647&XtraIDs=1647&sd=20+Jan+2007&ed=20+Apr+2007&author=cdrain&stype=1#xx1994839xx[^]" rel="nofollow">comment
Thanks a lot for the help... ok I'm able to create a UI-Thread from my MainWnd as I need to get the ActiveX functionality.
My Activex must fill the grid contained on the MainWnd, while the progressBar is incremented.
So I set the timer, that increment the progressbar on the OnTimer event, and create the ui-thread using this code I use:
thread = new CMyThread();
//Set parameter I need on the ActiveX
// Include the pointer to the grid (is it right?)
thread->GripPointer= GridPointer;
thread->par2 = par2;
thread->par3 = par3;
thread->CreateThread();
On my ui-thread code i fill the grid on the Run() method and at the end of the operation I PostMessage(..) to the MainWnd and here I close the ui-thread sending a
PostMessage(WM_INFORM_CLOSE, 0, 0);.
At Run-Time it gives me an error "Not valid pointer' when i call the function to fill the grid on the ui-thread.
WHY?
- Where I need to use the ::CoMarshalInterThreadInterfaceInStream(...) and ::CoGetInterfaceAndReleaseStream(...) method you said, and witch is they're scope? (Sorry I'm newer in this use )
- Have you an example code?
Another question:
But can I manage a graphic component of the MainWnd (the grid) from the ui-thread?? Is this my problem?
Thanks a lot
|
|
|
|
|
char dbBuff[INFO_BUFFER_SIZE]={0};
char HoldDBBuff[INFO_BUFFER_SIZE]={0};
DWORD dwBytesWrittenTrans;
HANDLE HND=CreateFile(FileName.c_str(),GENERIC_READ, NULL, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
BOOL read=ReadFile(HND,dbBuff,sizeof(dbBuff),&dwBytesWrittenTrans,NULL);
int dbCount=0;
int dbHoldCount=0;
bool proceed=false;
while (dbBuff[dbCount]!=0)
{
if (dbBuff[dbCount]=='*'||proceed)
{
strcpy((char*)HoldDBBuff[dbHoldCount], (const char*)dbBuff[dbCount]);
dbHoldCount++;
proceed=true;
}
dbCount++;
}
As soon as I try and do a strcpy, the IDE brings up the assembly code and a error occurs.
Can someone please help ??
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
|
Programm3r wrote: Stupid ....
When I first read this reply, I didn't know it was to yourself - I thought it was kinda
harsh!
I'm not sure about the above line, but, as Michael mentioned, those casts in the strcpy
call are suspicious (bad!)
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Programm3r wrote: strcpy((char*)HoldDBBuff[dbHoldCount], (const char*)dbBuff[dbCount]);
Why are you casting characters to character pointers?
|
|
|
|
|
I think I see what you're trying to do, but you need to take the address of dbBuff[dbCount] before casting it to a (const char*):
strcpy((char*)HoldDBBuff[dbHoldCount], (const char*)&dbBuff[dbCount]);
(Notice the & I added.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
What about the destination address?
Maybe
strcpy((char*)&HoldDBBuff[dbHoldCount], (const char*)&dbBuff[dbCount]);
??
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Yep, that one needs it, too. I guess I looked at it too quickly and thought that he was copying part of the source into the beginning of the destination.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
There is no need for those casts. Incorrect casts mask errors, and this was the case in the OP's original code. He probably threw in casts to "fix the compiler errors" and ended up with non-functional code.
|
|
|
|
|
Those are the OP's original casts - not mine. I know they aren't needed, but his main problem (as you eluded to in your first post) was that the buffer had already been dereferenced.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
When using Visual C++ 6.0 and 7.1 to create a message handler for WM_NCPAINT, the wizard places a comment in there...
void CSomeView::OnNcPaint()
{
// TODO: Add your message handler code here
// Do not call CScrollView::OnNcPaint() for painting messages
}
Because I don't want to draw the scroll bar myself, I call CScrollView::OnNcPaint() but I feel like I'm beaking some major programming rule but I do not know what that rule is. I've not been able to detect any problems with doing this except of course some redundant drawing that might occur elsewhere in the non-client area that causes a teeny tiny amount of flicker where my drawing code differs from that of he default.
Does anyone know why the "Do not call CScrollView::OnNcPaint() for painting messages" warning gets placed in this handler and what is it intended to prevent?
|
|
|
|
|
Because in general, if you handle WM_NCPAINT , you're going to repaint the whole NC area for skinning or some similar purpose. The comment is just an advisory that if you do call the base class function, you'll get the standard NC area, which is not usually what you want because you're handling WM_NCPAINT . The world won't end if you call it, but you will end up with double the painting work and possibly flicker.
|
|
|
|
|
Thanks for the assistance.
|
|
|
|
|
Hi all,
I would like to know whether this is a healthy way to terminate another process?
HANDLE pid=win.winftp_findPid("application.exe");
BOOL p=TerminateProcess(pid, STILL_ACTIVE);
Many Thanks.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
I would try to send a WM_CLOSE message first... and if the application doesn't respond, then kill
|
|
|
|
|
toxcct wrote: then kill
lol ... thanks for the info toxcct.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Thanks toxcct.
It works....
HWND hWnd=FindWindow(NULL, "Window Name");
SendMessage(hWnd, WM_CLOSE , NULL, NULL);
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Welcome
|
|
|
|
|
Actually no, TerminateProcess() should be the last thing you try. You'd better hope the app wasn't in the middle or writing to some crucial data file when you killed it.
|
|
|
|
|
My english is very poor. I'm sorry.
Maybe I can not express my meaning clearly, so, Please look at the codes below.
<br />
...............<br />
SetWindowsHookEx(WH_CBT,(HOOKPROC)CBTProc.........<br />
...............<br />
<br />
LRESULT CALLBACK CBTProc(int nCode, WPARAM wParam, LPARAM lParam)<br />
{<br />
if(nCode == HCBT_CREATEWND)<br />
{<br />
HWND hWnd = (HWND) wParam;<br />
LPCBT_CREATEWND pcb = (LPCBT_CREATEWND) lParam;<br />
TCHAR szClassName[255] = _T("\0");<br />
<br />
GetClassName( hWnd, szClassName,sizeof(szClassName) / sizeof(TCHAR) );<br />
<br />
if(! lstrcmp(szClassName, _T("Button")))<br />
{<br />
CButtonST * pNewButton = new CButtonST;<br />
if( pNewButton )<br />
pNewButton->SubclassWindow( hWnd );<br />
}<br />
}<br />
return CallNextHook( nCode, wParam, lParam);<br />
}
These codes works well in other windows, dialogbox, but they can not work in messageBox, Why????
-- modified at 1:29 Sunday 22nd April, 2007
|
|
|
|
|
sdhexu wrote:
These codes works well in other windows, dialogbox, but they can not work in messageBox, Why????
are you able to hook the messagebox!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hi
All
I want to change font of ToolTip control in My project.So anybody have some hint or code to change font of Tooltip control.
Thanks in Advance
Atul
|
|
|
|
|