|
If you wish, check BCGDateTime control, which is free on there site, you can download code and example, which may give you some idea.
Anand
|
|
|
|
|
Hi,
I want to use STL containers(list,string.....) in my MFC application.
The problem is that I keep getting errors.
for example, when I declare :
using namespace std;
I get this error:
--------------------Configuration: DLLTest - Win32 Debug--------------------
Compiling...
DLLTestDlg.cpp
D:\eli_v\DLLTest\DLLTestDlg.cpp(12) : error C2871: 'std' : does not exist or is not a namespace
Error executing cl.exe.
DLLTest.exe - 1 error(s), 0 warning(s)
and when i declare :
#include <string>
string s;
I get these strange errors:
--------------------Configuration: DLLTest - Win32 Debug--------------------
Compiling...
DLLTestDlg.cpp
D:\eli_v\DLLTest\DLLTestDlg.cpp(12) : error C2871: 'std' : does not exist or is not a namespace
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2061: syntax error : identifier 'THIS_FILE'
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(35) : error C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\new(36) : error C2061: syntax error : identifier 'THIS_FILE'
c:\program files\microsoft visual studio\vc98\include\new(37) : error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(37) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,const struct std::nothrow_t &)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl op
erator new(void))(unsigned int)'
c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\new(41) : error C2061: syntax error : identifier 'THIS_FILE'
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2091: function returns function
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2556: 'void *(__cdecl *__cdecl operator new(void))(unsigned int,void *)' : overloaded function differs only by return type from 'void *(__cdecl *__cdecl operator new(void))(unsig
ned int)'
c:\program files\microsoft visual studio\vc98\include\new(35) : see declaration of 'new'
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2809: 'operator new' has no formal parameters
c:\program files\microsoft visual studio\vc98\include\new(42) : error C2065: '_P' : undeclared identifier
D:\eli_v\DLLTest\DLLTestDlg.cpp(14) : error C2146: syntax error : missing ';' before identifier 's'
D:\eli_v\DLLTest\DLLTestDlg.cpp(14) : error C2501: 'string' : missing storage-class or type specifiers
D:\eli_v\DLLTest\DLLTestDlg.cpp(14) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
DLLTest.exe - 15 error(s), 0 warning(s)
|
|
|
|
|
eli15021979 wrote:
using namespace std;
This is generally a very bad idea! This exposes everything in the std namespace to the current (mostly global) namespace. You ask for problems if you do this...
You should use: #include <string><br>std::string s; instead. I don't know if it solves your problem, but it is a better programming practice.
eli15021979 wrote:
D:\eli_v\DLLTest\DLLTestDlg.cpp(12) : error C2871: 'std' : does not exist or is not a namespace
This error implies that the std namespace is not known. There can be many reasons for this. Some of the many reasons could be:
<list> You din't include a header from the std library before the declaration
You are in a other namespace (except for the global namespace) in which the 'std' namespace is not declared.
You included a std header in a namespace other than the global and made the std namespace part of the other namespace and now you are trying to access it from the global namespace...
etc..
I hope that this information helps you to narrow down your problem.
Good luck!
I also got the blogging virus..[^]
|
|
|
|
|
Hello
I was download the "MOTLY FOOL" toolbar project and I build it
And every thing become right
But when I want to add a Dialog Using MFC the project rejected that
So
How I can add a new MFC object to "MOTLYFOOL" project?Thanks.
|
|
|
|
|
Hi,
does anybody knows if I can programmatically add and remove controls to a CView(derived) class and attach event handlers without message maps? If it is possible please refer to an article or describe the method.
Thanks
|
|
|
|
|
I wish to access my video card's driver directly, can someone point me in the right direction to do this?
|
|
|
|
|
Try DirectX[^].
Any other access will be proprietary to the card manufacturer, and not likely to be well documented.
Software Zen: delete this;
|
|
|
|
|
I figured as much, Directx drivers are well and good, but I'm a freak for optimizations, besides I'm just trying to do a few wacky things.
|
|
|
|
|
How can I "reopen" std::cin and std::cout in binary mode in a console app with VC++?
|
|
|
|
|
Hi codeproject friends.
How to execute a .bat file from Visual C++, without command line window emerge after.
Thanks.
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
In the past I've used:
CreateProcess with the CREATE_NO_WINDOW flag.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
|
Hi hope someone can help with a little problem I’ve been having
I have been modding a SHBrowseForFolder dialog, adding some extra items like edit boxes, list boxes etc
I am trying to add another TreeList like the folder view already in the dialog. I can create the treelist fine, add items to it, create an image list etc, however it is not sending any messages like TVN_ITEMEXPANDING or TVN_ITEMEXPANDED (Ones I really need!)
I create the treelist when the SHBrowseForFolder’s callback function has the BFFM_INITIALIZED message, and use the follow function:
HWND InfoListBox = CreateWindowEx( 0, WC_TREEVIEW, TEXT("Tree View"), WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS, 278, 5, 244, 318, hwnd, (HMENU) ID_TREEVIEW, NULL, NULL);
I have no way of receiving any notification message from the browse dialog so I use:
SetWindowLong(hwnd,GWL_WNDPROC, (LONG) MCBSProcInfoListbox);
To set a function to do so (NB, I’ve also tried using “DWL_DLGPROC” instead of “GWL_WNDPROC” here too, but it makes no difference)
The function looks like this:
LRESULT APIENTRY CFolderBrowse::MCBSProcInfoListbox(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
if(uMsg == WM_NOTIFY)
{
LPNMHDR pnmh = (LPNMHDR) lParam;
if(pnmh->hwndFrom == InfoListBox
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pnmh;
if(pNMTreeView->hdr.code == TVN_ITEMEXPANDING)
{
…
}
}
}
return CallWindowProc(g_ItemProc, hwnd, uMsg, wParam, lParam);
}
Plenty of notification messages are called, but they all relate to mouse movements and button presses, none of the TVN_ messages are ever received.
I’ve also tried setting a function exclusively for the treelist
g_ItemProc = (WNDPROC) SetWindowLong(ItemListBox, GWL_WNDPROC, (LONG) MCBSProcItemListbox);
But that doesn’t work either
I’m hoping that I’ve just made a simple and rather obvious error, but I’m guessing I’ve not >_< If anyone could tell me what I have done wrong I’d be very grateful!
Cheers
Daniel
|
|
|
|
|
Hi,
Trying to use BroadcastSystemMessage in a simple Windows app using
Microsoft VisualC++ NET 2003 . Windows XP Pro. My program is basically just a shell with some code to call this function. The subroutine that calls the function is a simple c routine called in main although the app is C++ code. Just trying to see if the function will do what I need before working on a real application.
I get this link error.
MyProgram error LNK2019: unresolved external symbol "long __cdecl BroadcastSystemMessage(unsigned long,unsigned long *,unsigned int,unsigned int,long)" (?BroadcastSystemMessage@@YAJKPAKIIJ@Z) referenced in function "void __cdecl sendMouseStuff(void)" (?sendMouseStuff@@YAXXZ)
I dumpbin the user32.lib and I see the call inside for
BroadcastSystemMessage
BroadcastSystemMessageW
BroadcastSystemMessageA
I tried to call it with all three endings. no change.
My program includes the files that define the function.
#include <windows.h>
#include <winable.h> // the real definiton is in here
#include <winuser.h> // this one seems to not matter.
The VC dev properties say that user32.lib is to be linked into the program.
I can compile and link if I use the call SendMessage() which also comes out of user32.lib. But if I ask it to use BroadcastSystemMessage it acts like it never heard of it. I notice that SendMessage does only have A and W variations, no simple SendMessage in there.
Guess I am not doing something right, but I have no clue what that is.
Any help would be appreciated.
John
|
|
|
|
|
Double check your linker path settings and make sure you are not including an older version of the user32.lib while linking. Maybe you picked up the older one from Visual Studio 6.0 or something when the BroadcastSystemMessage was not defined in the LIB file.
|
|
|
|
|
Blake, Thank you for the reply.
I did once have VC 6 but it is gone and the linker is pointing to the VC7 directories.
Another guy suggested to look at the decoration and said it had to match to work. dumpbin only shows _BroadcastSystemMessage@20 instead of the rather complex name that VC7 is looking for with a string of capital letters after the name.
I'll keep looking. I expect it is something simple like linker options.
John
|
|
|
|
|
|
Hi,
I hope you know you can't compile it in Visual c++(this code is for pocket PC,so you must compile it in embedded visual c++).
anyway'try to ask this question is the Mobile/Embedded Message Boards,Maybe they can help you.
Regards,
Eli
|
|
|
|
|
I am trying it in embedded VC++ .
If I post it in the embedded forum, it takes days to get a reply. sometimes no reply at all.
I posted here bcoz I thought the error was common.
-hithesh
|
|
|
|
|
Hi,
Are you sure that yours project settings are correct?
if you are working with the emulator,you need to choose these options from
the combo box of the editor:
from the "Select active configuration" combo box,select the "Win32 (WCE emulator) debug/release" option.
form the "select default device" combo box select the "Pocket PC 2003 emulator" option.
if you are working directly with your IPaq,you need to choose these options from the combo box of the editor:
from the "Select active configuration" combo box,select the "Win32 (WCE ARMV4) debug/release" option.
form the "select default device" combo box select the "Pocket PC 2003 device"
option.
Note :
1. I think the debug option is better then the release option,because
the release option has a lot of bugs.
2. I saw your question about "How to download my application to my device".
Well,you need to put your ipaq in the cradle,choose the options above
(not for the emulator!!!) and Execute the program(ctrl + F5 , but i'm not
sure)
3. Make sure that you chose the correct option for the default device AND for
the active configuration(do not mix between option for the active
configuration and option for the default device).
Well,I hope this will help you.
Good luck,
Eli;)
|
|
|
|
|
Hi Guys.
I really would appreciate some help with this cause I'm drawing
nothing but blanks!
I made my first Visual C++ program in ver. 7. Its a client/server
networking filetransfer sort of a program. The problem occurs when
I start the client program on another machine, that hasn't got VC++
installed. At first it complained that is was missing some DLL's.
Unable to find out how to get the same results as you do with Borland
C++ Builders, Disable runtime packages and Dynamic linking (which compiles
everything into a single huge .exe) I tried using MFC (the program is
dialog style) as a static library and as windows standard. This works,
the program now actually runs. But as soon as I try to initiate a file-
transfer, the program is shutdown by windows due a critical error.
Please help me out.
Shine
|
|
|
|
|
Extra note:
I think the error might come from this like in sockcore.cpp:
if (pState->m_pmapSocketHandle->IsEmpty())
Im not sure though
Shine
|
|
|
|
|
Try running the program under the debugger, so that you can see where it stops. If the program stops in a library routine, chances are you have provided a bad argument value.
When you are debugging this sort of application, you really need to run both the client and the server in the debug environment, so you can tell what is happening.
Software Zen: delete this;
|
|
|
|
|
i need help in calling matlab functions from c++ i got some examples but when i implement them i get an error saying that <matlab.h> and many other library files are undeclared . So i want to know if <matlab.h> is already found on the VC++ complier or need to be included and if so where can i find it and how can i include it .
gobar
|
|
|
|
|
bPulseStream.add(0xdb);
bpulsestream is of type CBytearray
This is used to generate a 40Khz IR pulse.
Here's the full code -
#define CharWidth 73<br />
<br />
bPulsestream.Setsize(charwidth*4, 16); <br />
<br />
for(int i=0; i < charwidth*4; i++)<br />
<br />
{<br />
bpulsestream.Add(0xdb);<br />
<br />
}
Thanks in advance.
-hithesh
|
|
|
|