|
Can any body help me to access printer in VC++
Thanks in advance
|
|
|
|
|
1) Click the top left corner of the page where it has the Bob Image and says "The Code Project"
2) After the home page loads look in the left column for the black bar that says "Sections"
3) Under Sections look for "General C++" and click it. That will open a new list of choices
4) Click "Printing"
Good luck
|
|
|
|
|
if you want to print you can use of StartDoc EndDoc for get name of printers see EnumPrinters .
|
|
|
|
|
Hi All,
I am using MFC Application.I am going to include Existing project in to my Project's Workspace.
I have new project of type static library OK.Noew I got problem when I am going to include header file of that new project in my MFC project's class.I got error like below.......
1>d:\testing_and_download\testing\testrtmp_working\testrtmp\rtmpdesk.h(2) : fatal error C1083: Cannot open include file: 'omnithread.h': No such file or directory
Here,
omnithread is my new project and in that I have omnithread.h file.In this project I have used the thread classes which i want to access here in my MFC project.
Ok. Thanks In Advance.
Ashish
|
|
|
|
|
use Full path or absolute path
like "..\\newprojectfoldername\\omnithread.h"
|
|
|
|
|
When I give the full path then it gives the error like...........
1>d:\testing_and_download\testing\testrtmp_working\testrtmp\omnithread\omnithread.h(137) : fatal error C1189: #error : "No implementation header file"
And I hope It comes from omnithread.h file in which I have defined like..........
****************************************************
#if defined (_OMNITHREAD_DLL) && defined(_WINSTATIC)
#error "Both _OMNITHREAD_DLL and _WINSTATIC are defined."
#elif defined(_OMNITHREAD_DLL)
#define _OMNITHREAD_NTDLL_ __declspec(dllexport)
#elif !defined(_WINSTATIC)
#define _OMNITHREAD_NTDLL_ __declspec(dllimport)
#elif defined(_WINSTATIC)
#define _OMNITHREAD_NTDLL_
#endif
// _OMNITHREAD_DLL && _WINSTATIC
#else
// Not using MSVC++ to compile
#define _OMNITHREAD_NTDLL_
#endif
// _MSC_VER
#elif defined(__sunos__) && (__OSVERSION__ == 5)
#ifdef UsePthread
#include <omnithread posix.h="">
#else
#include <omnithread solaris.h="">
#endif
#elif defined(__linux__)
#include <omnithread posix.h="">
#elif defined(__nextstep__)
#include <omnithread mach.h="">
#elif defined(__VMS)
#include <omnithread posix.h="">
#elif defined(__SINIX__)
#include <omnithread posix.h="">
#elif defined(__osr5__)
#include <omnithread posix.h="">
#elif defined(__irix__)
#include <omnithread posix.h="">
#else
#error "No implementation header file" ///////////ERROR Message Is like this
#endif
******************************************************************
Sorry for big code but I hope error comes from here and I have no that to much idea about this definition.
Thanks Hiru.
Ashish
|
|
|
|
|
|
The data packets received from NIC may have Indefinite length,and among the data may include '\n','\t','\0',and so on .
If I do not want to new and delete a char ** every time according to the size of data packet , are there any advanced tools or structurs can be used? Thanks for your help~
Never to say never~
|
|
|
|
|
can you put your question more clearer?
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
Michel_Huang wrote: are there any advanced tools or structurs can be used?
Yes, and guess how they work? They will new and delete heap memory every time according to the size of data packet. Standard Template Library[^]
|
|
|
|
|
ye~ I see ,thank you ~
Work hard. Laugh often. Keep your honor. Never to say never
|
|
|
|
|
If you're using UDP packets, the recv API does not allow you to read a bit of the packet then the rest of the packet. It gives you the data up to the size of the buffer you supply then discards the rest. Peeking to find out how much data is present is unreliable. You should define a maximum size packet supported and use a buffer that size. You can simply reuse the buffer once you've processed the data. The maximum packet size supported by the TCP stack can be retrieved with getsockopt , passing the SO_MAX_MSG_SIZE parameter.
TCP does not preserve message boundaries. What you see at the receiver can be only part of a single call to send or it can be the result of multiple calls to send . If required, you must put some kind of framing on top of the raw data. Best practice is again to define a fixed size buffer and be prepared to handle any size of data that's returned, which can be as low as one byte.
You should probably read the Winsock Programmer's FAQ[^].
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
Thank you ~
Work hard. Laugh often. Keep your honor. Never to say never
|
|
|
|
|
I am using vfw to extract frames from an avi files. I;d like to know if the bit depth of the frame is available in the AVIFILEINFO structure or in any other structure.
|
|
|
|
|
Assuming you mean video...
You need to get that from the appropriate stream. That means you need to
use AVIStreamReadFormat() or open the stream and read a frame to get a BITMAPINFO struct.
From that struct, the BITMAPINFOHEADER.biBitCount field is what you want.
See AVIStreamReadFormat(), AVIStreamGetFrameOpen(), AVIStreamGetFrame(), etc.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I know there is a fund raiser thermometer on this site, but I don't know how to install it. I want to install a "indicator" on my blog toward a financial goal. Does anybody know where I can get one from or can you help me use the one that's on here.
Thanks
|
|
|
|
|
can you explain me what a fund raiser thermometer is?
please...
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
Happy birthday to you in code project and
welcome to code project.
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
never mind i figured something out
|
|
|
|
|
can you explain what you have figured out?
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
I need to write a .dll (c++) that will be loaded by software running on Windows 95 from a VB-ish application. I have the .dll written and working on Windows XP and Windows 2000.
When I try to load the .dll in Windows 95 I get an error saying that the .dll could not be found. If I try regsvr32 c:\DLL.dll I an error "GetLastError return 0x00000485" which, according to MSDN, means that it could not find the .dll. Note that I don't actually need to register the .dll; I was just using regsvr32 to test if the problem was the VB-ish app or Windows.
Basically, is seems like Windows 95 isn't recognizing the file as a .dll. I only have VS2005 for development. Is there some settings that I need to adjust to allow Windows 95 to recognize it as a .dll?
Thanks
|
|
|
|
|
My guess is that you are calling some API function that is not supported in W95. If the OS can't find all the dependencies, it will not load the DLL. 2005 is not a problem, per se, but it defaults to windows version 5.1, which is XP. Try changing / adding the following two defines to your stdafx.h (or add them via Project Settings) which will target your DLL to W95. Recompile and see if the compiler has tagged some function call as undefined.
#define WINVER 0x0400<br />
#define _WIN32_WINNT 0x0400
Judy
|
|
|
|
|
Greetings!
I'm sure thousands of people have done this, but I haven't found any samples I can work with.
I want to save the ratio between the top and bottom halves of a two-pane splitter window after the splitter bar is moved. Then, if the window is resized, I can reposition the bar so that the ratio remains constant.
I have a class derived from CSplitterWnd. I can catch the WM_NCHITTEST message and store false in a member variable if the call to CSplitterWnd::OnNcHitTest() returns HTNOWHERE and store true otherwise. I thought after that it would be a simple matter of catching the mouse up event. But it looks like that event isn't fired! Using Spy++, I saw a WM_MOUSE_ACTIVATE message, but it doesn't seem to be possible to catch that, unless I'm missing something, which is very likely. I saw something that said that CSplitterWnd objects have StartTracking() and StopTracking() virtual methods, which would be great, except that the CSplitterWnds in Visual C++ 6.0 don't seem to have those methods. So how do I do this?
RobR, yet again frustrated that something so simple should be so hard
|
|
|
|
|
What about the WM_SIZE message of the views that result from the moving of the splitter?
|
|
|
|
|
I try to use the method wcscpy_s to copy BufferSource to BufferDestinationto.
The 2 buffer type is LPTSTR.
When i define the second parameter in the function wcscpy_s in HARD CODE all work fine.
But i want to define it in runTime - i use the function _tcslen to find the number of elements i want to copy ( in this case i want to copy all strSource to strDestination ) - but i crash each time i try to make the copy.
The code:
LPTSTR BufferDestinationto[256], strSource[256];<br />
.<br />
. [ Some code that add information to BufferDestinationto ]...<br />
.<br />
<br />
wcscpy_s(BufferDestinationto, _tcslen(strSource), strSource );
MY crach is in the wcscpy_s and this happand because the _tcslen function.
Thansk form any halp.
|
|
|
|