|
Post what you have so far.
|
|
|
|
|
dtaylor01 wrote: 1>;c:\documents and settings\chuckie taylor\my documents\c++ assignments\assignments 3\assignment 3\assignment 3\assignment 3.cpp(50) : error C2143: syntax error : missing ';' before '<<'
The code you've shown does not have 50 lines so we can't possibly know what exactly is causing the problem. Look at lines 49 and 50 to see if anything is missing.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
<this my="" be="" a="" dumb="" but="" code="" tag="" is="" when="" you="" use=""> symbol in your work right? >
|
|
|
|
|
Sorry for reposting, but I'm hoping to post the question better. I am using Visual Studio 2008, trying to use a vendor supplied dll. I was given the .h, .lib, and .dll files. In the project, I #include "header", link the .lib file to the project, and physically place the .lib and .dll files in the search path. Here is the gist of the header file.
#ifndef __GP3_HEADER_AWC
#define __GP3_HEADER_AWC
extern "C" {
__declspec(dllimport) HANDLE __stdcall GP3OpenCom(int port);
__declspec(dllimport) void __stdcall GP3CloseCom(HANDLE);
__declspec(dllimport) void __stdcall GP3SetLED(HANDLE h,BOOL state);
...}
#endif
But when I try to build it, I get alot of errors thrown at me. Here is a collection of the first few errors.
1>Compiling...
1>main.cpp
1>c:\documents and settings\administrator\my documents\geno\programs\gp3\gp3\gp3.h(5) : error C2143: syntax error : missing ';' before '__stdcall'
1>c:\documents and settings\administrator\my documents\geno\programs\gp3\gp3\gp3.h(5) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\documents and settings\administrator\my documents\geno\programs\gp3\gp3\gp3.h(5) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\documents and settings\administrator\my documents\geno\programs\gp3\gp3\gp3.h(6) : warning C4229: anachronism used : modifiers on data are ignored
1>c:\documents and settings\administrator\my documents\geno\programs\gp3\gp3\gp3.h(6) : error C2182: 'GP3CloseCom' : illegal use of type 'void'
What is going on here? Am I doing something wrong, or is there something messed up with the header file?
|
|
|
|
|
The compiler does not know what HANDLE is. You have to #include <windows.h> before you include this header file.
|
|
|
|
|
Just wondering,does anybody tried this enhancements of VS2008 MFC?
What pro and contras?
Thanks.
|
|
|
|
|
Hi,
In my application i need to put an interface with navigation like norton antivirus'interface(like graphical menu items in the left side of the app. Items will be displayed only if the user clicks a item in the left side.)
Please tell me how to begin.
Regards,
John
|
|
|
|
|
Well, it sounds like a splitter window with two panes. The one on the left is a list view that contains icons, and the one on the right could be some other view.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Hello, can you write an example for me (I am not able to do this) for with DragDropHandlers catch file copy or move and get this arguments to a program and not at the system.
For that's I use my own copier for do the copy.
Thanks for your help.
|
|
|
|
|
alpha_one_x86 wrote: (I am not able to do this)
Can't or won't? Have you searched for WM_DROPFILES or DragQueryFile() ? As an added bonus, see here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I'am just not able because I work in Qt not in api win32. I don't understand how do it (It's 1years what I search).
|
|
|
|
|
I have used NtQueryInformationProces, struct PROCESS_BASIC_INFORMATION and struct PEB etc to access process info and then retrieve its arguments. It works great in WIN32 but stops working in WIN64 mainly because of the address space problem. Just be clear I am using 64 bit process to access other 64 bit process's info (its parent process). Can any body provide hint!
Thanks!
Jack Rong
|
|
|
|
|
Jack Rong wrote: I have used NtQueryInformationProces, struct PROCESS_BASIC_INFORMATION and struct PEB etc to access process info and then retrieve its arguments.
I'm curious ... why are you using a deprecated function?
The docs state
"It is best to use the CheckRemoteDebuggerPresent and GetProcessId
functions to obtain this information."
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi all..
I've a dialog box in which i'm using AnimateWindow. Everything is OK but whenever my dialog Animate(Up to down in may case with the help of)
AnimateWindow(hWnd, 300, AW_SLIDE | AW_VER_NEGATIVE);
My mouse just gets busy if i put on Dialog Box.. I mean busy Icon and i can't click on any of the control inside it..
I know it's refreshing everytime it moves. But how can i overcome this problem..
Thanks all
|
|
|
|
|
I don't know anything about AnimateWindow but if it is using the UI thread to do a bunch of processing then you can't click on anything in the UI, period, regardless of what the mouse cursor looks like.
led mike
|
|
|
|
|
When AnimateWinodw finishes it's processing then it waits for 4 seconds and then pop back. I need to click at the time when it wait for 4 second. I know i can't click anything when it's playing animation. Just need to click when it stops for 4 second...
|
|
|
|
|
Do i need to update or invalidate the Window when animatewindow stops??
I tried that but no success. Can someone throw any light on that??
Thanks..
|
|
|
|
|
Hi
Please excuse my english. I'm from germany.
Does anybody know if it's possible to call managed code (c#) from VC++ 6.0? I already found the ManWrap Library, but this library does not work with VC++ 6.0.
I hope somebody knows an alternative.
Thank you very much in advance
modified on Tuesday, October 14, 2008 10:30 AM
|
|
|
|
|
Why are you doing it anyways? If you are already using managed code, why not just write the entire thing in managed code?
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
I know. But in this case this doesn't work. It has to be VC++ 6.0. Not my decision.
|
|
|
|
|
This is not really the right forum and I'm not an expert but I think the answer you're looking for is COM InterOp. VC++6 can create and also use COM objects, so can C# through the InterOp library. At worst you'll need to create a separate 'broker' object that's an 'automation' compatible COM object which is written in C++ but CoCreated from the C# side and talks with the rest of your C++ code by COM or whatever means you wish.
C#Class ---> CoCreate functionality in OS ---> automation COM object ---> Your C++ stuff
C#Class <--- InterOp functionality in OS <--- automation COM object <--- Your C++ stuff
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Thanks that helped me a lot!
Could i also write the COM object in C#, expose it and call it from VC++ 6.0?
|
|
|
|
|
playxn wrote: Could i also write the COM object in C#, expose it and call it from VC++ 6.0?
I think that should be possible but I've never done it that way round myself. I'm not sure how you'd do an automation compatible COM object in C# itself but then I'm no C# expert. I guess the guys on the C# forum will know all about it though. Good luck.
"The secret of happiness is freedom, and the secret of freedom, courage."
Thucydides (B.C. 460-400)
|
|
|
|
|
Hello,
I am working on a chat application where we enter some text in the edit box.
The text i need to convert it in UTF8 encode. I am able to encode it but there is only one problem that is if the text consist of + or & sign it is not able to convert and the text after + or & sign is omitted.
Please tell me whats the problem.
I am sending the code.
void CChatDlg::OnSendmsg()
{
CString strText;
GetDlgItemText(IDC_EDIT,strText);
strText = g_ChatManager.UTF8andURLEncode(strText);
}
CString CChatManager::UTF8andURLEncode(CString sIn)
{
return EncodeToUTF8(sIn);
}
CString CChatManager::URLEncode(CString sIn)
{
CString sOut;
const int nLen = sIn.GetLength();
for (int i = 0; i<nLen; i++)
{
TCHAR c = sIn.GetAt(i);
if(iswalnum(c))
sOut.AppendChar(c);
else
if(_istspace(c))
sOut.AppendChar(_T('+'));
else
{
int ic = _TINT(c);
sOut.AppendChar(_T('%'));
sOut.AppendChar(toHex((BYTE)(ic>>4)));
sOut.AppendChar(toHex((BYTE)(ic%16)));
}
}
sOut.AppendChar(_T('\0'));
return sOut;
}
CString CChatManager::EncodeToUTF8(LPCTSTR szSource)
{
WORD ch;
BYTE bt1, bt2, bt3, bt4, bt5, bt6;
int n, nMax = _tcslen(szSource);
CString sFinal, sTemp;
for (n = 0; n < nMax; ++n)
{
ch = (WORD)szSource[n];
if (ch == _T('='))
{
sTemp.Format(_T("%%%02X"), ch);
sFinal += sTemp;
}
else if (ch < 128)
{
sFinal += szSource[n];
}
else if (ch <= 2047)
{
bt1 = (BYTE)(192 + (ch / 64));
bt2 = (BYTE)(128 + (ch % 64));
sTemp.Format(_T("%%%02X%%%02X"), bt1, bt2);
sFinal += sTemp;
}
else if (ch <= 65535)
{
bt1 = (BYTE)(224 + (ch / 4096));
bt2 = (BYTE)(128 + ((ch / 64) % 64));
bt3 = (BYTE)(128 + (ch % 64));
sTemp.Format(_T("%%%02X%%%02X%%%02X"), bt1, bt2, bt3);
sFinal += sTemp;
}
else if (ch <= 2097151)
{
bt1 = (BYTE)(240 + (ch / 262144));
bt2 = (BYTE)(128 + ((ch / 4096) % 64));
bt3 = (BYTE)(128 + ((ch / 64) % 64));
bt4 = (BYTE)(128 + (ch % 64));
sTemp.Format(_T("%%%02X%%%02X%%%02X%%%02X"), bt1, bt2, bt3, bt4);
sFinal += sTemp;
}
else if (ch <=67108863)
{
bt1 = (BYTE)(248 + (ch / 16777216));
bt2 = (BYTE)(128 + ((ch / 262144) % 64));
bt3 = (BYTE)(128 + ((ch / 4096) % 64));
bt4 = (BYTE)(128 + ((ch / 64) % 64));
bt5 = (BYTE)(128 + (ch % 64));
sTemp.Format(_T("%%%02X%%%02X%%%02X%%%02X%%%02X"), bt1, bt2, bt3, bt4, bt5);
sFinal += sTemp;
}
else if (ch <=2147483647)
{
bt1 = (BYTE)(252 + (ch / 1073741824));
bt2 = (BYTE)(128 + ((ch / 16777216) % 64));
bt3 = (BYTE)(128 + ((ch / 262144) % 64));
bt4 = (BYTE)(128 + ((ch / 4096) % 64));
bt5 = (BYTE)(128 + ((ch / 64) % 64));
bt6 = (BYTE)(128 + (ch % 64));
sTemp.Format(_T("%%%02X%%%02X%%%02X%%%02X%%%02X%%%02X"),
bt1, bt2, bt3, bt4, bt5, bt6);
sFinal += sTemp;
}
}
return sFinal;
}
Please help me
Thanks In advance
Dhiraj
|
|
|
|
|
Couldn't you just use WideCharToMultiByte(CP_UTF8, ...)?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|