|
What files is it looking for ? You should have all the files you need, I'd have thought.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
There is a sample project here:
http://www.codeproject.com/listctrl/xlistctrl.asp
If I download and compile it, I get errors. It just seems like
every Unicode project I download compiles with errors. There is
always something missing. It must be me.
|
|
|
|
|
I guarantee it is not you! The files are there or they are not, ‘Hans Dietrich’ is one of the best at CP. So go to MS and make sure you are up to date. If you are using VC6 or above, then you should not be having these problems, if you do then there is a flaw in the code or (god fobbed) your understanding.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi all,
can anybody please tell me what is the difference between window socket and CSocket class
thanks in advance
|
|
|
|
|
The latter is a VC++ wrapper around the former.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi to all,
1) What is use of Abstract Class? What it's advantage over normal Class?
2) As I know,
=>Steps in TCP Server are,
(1).Create TCP Socket (using SOCK_STREAM), (2).Bind to a Port, (3).Listen, (4).Accept a connection (from Client), (5).Send & Receive Data
=>Steps in TCP Client are,
(1).Create TCP Socket (using SOCK_STREAM), (2).Connect to a Socket(TCP Server), (3).Send & Receive Data
=>Steps in UDP Client are,
(1).Create UDP Socket (using SOCK_DGRAM), (3).Send Data to a UDP Socket; Receive Data from a UDP Socket
Am I right?
What are the step to be done in UDP Server?
When I searched it in Google, I found that UDP Socket can use 'Connect()' ! But how it is possible if UDP is Connectonless?
3) In VC6, how to get Pixels of a JPEG Image? How to show image using it's pixels on the Dialog?
|
|
|
|
|
Aniket Salunkhe wrote: What is use of Abstract Class? What it's advantage over normal Class?
It can define an interface with no implimentation. C# has interfaces, C++ does not, this is one way to get them.
Aniket Salunkhe wrote: In VC6, how to get Pixels of a JPEG Image?
Use GDI+ ( this involves finding a PSDK that works with VC6 ), or use a library like CXImage or Paintlib. Or, get a decent C++ compiler
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
1) An abstract class has at least one pure virtual function. That means that an object can't be
created of that class' type. It can only be used as a base class. This defines virtual methods
for a class heirarchy while forcing derived class(es) to provide an implementation. I guess
one advantage is that using a pointer/reference to an abstract type, you are assured that any pure
virtual functions have a derived class implementation.
2) connect() when used on a UDP socket just sets the default destination address so if you
use send(), the datagram will be sent to the "connected" address. If you don't use connect then
you have to use sendto() to send a datagram. If you do use connect() then you can use send()
and/or sendto().
3) The JPEG compressed data needs to be uncompressed to get pixel data suitable for displaying.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Aniket Salunkhe wrote: What is use of Abstract Class? What it's advantage over normal Class?
Good Grief... are you kidding? JFGI[^]
An abstract class, or abstract base class (ABC), is one that is designed only as a parent class and from which child classes may be derived, and which is not itself suitable for instantiation. Abstract classes are often used to represent abstract concepts or entities. The incomplete features of the abstract class are then shared by a group of sibling sub-classes which add different variations of the missing pieces. In C++, an abstract class is defined as a class having at least one pure virtual method, i.e., an abstract method, which may or may not possess an implementation.
led mike
|
|
|
|
|
blah blah bla...a bunch of useless techno-babble. Everyone knows the advantage is being able to
say "I used an abstract class" and nobody knows what you're talking about.
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
You can use OleLoadPicture().
The following code two-steps it - loads the JPG into a HBITMAP then draws the HBITMAP
If you just wanted load & draw it w/o the intermediate BMP you could call pPic->Render() into the dialog's DC.
#include <Ole2.h>
#include <olectl.h>
#define HIMETRIC_INCH 2540
HBITMAP LoadJpgFile(LPCTSTR filename)
{
HBITMAP hBmp = NULL;
if(filename && *filename)
{
HANDLE hFile = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
if(hFile)
{
DWORD dwFileSize = GetFileSize(hFile, NULL);
HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, dwFileSize);
if(hGlobal)
{
LPVOID pvData = GlobalLock(hGlobal);
if(pvData)
{
DWORD dwBytesRead = 0;
BOOL bRead = ReadFile(hFile, pvData, dwFileSize, &dwBytesRead, NULL);
GlobalUnlock(hGlobal);
if(bRead && (dwBytesRead==dwFileSize))
{
LPSTREAM pstm = NULL;
HRESULT hr = ::CreateStreamOnHGlobal(hGlobal, TRUE, &pstm);
if(pstm)
{
LPPICTURE pPic = NULL;
hr = ::OleLoadPicture(pstm, dwFileSize, FALSE, IID_IPicture, (LPVOID*)&pPic);
if(pPic)
{
long lWidth=0, lHeight=0;
pPic->get_Width(&lWidth);
pPic->get_Height(&lHeight);
HDC hMemDC = CreateCompatibleDC(NULL);
if(hMemDC)
{
int nWidth = MulDiv(lWidth, GetDeviceCaps(hMemDC, LOGPIXELSX), HIMETRIC_INCH);
int nHeight = MulDiv(lHeight, GetDeviceCaps(hMemDC, LOGPIXELSY), HIMETRIC_INCH);
if((nWidth>=0) && (nHeight>=0))
{
HDC dcScreen = GetDC(NULL);
if(dcScreen)
{
HBITMAP hJpgBmp = ::CreateCompatibleBitmap(dcScreen, nWidth, nHeight);
if(hJpgBmp)
{
HBITMAP hPrevBmp = (HBITMAP)::SelectObject(hMemDC, hJpgBmp);
RECT rect = {0,0, nWidth,nHeight};
hr = pPic->Render(hMemDC, 0, 0, nWidth, nHeight, 0, lHeight, lWidth, -lHeight, &rect);
::SelectObject(hMemDC, hPrevBmp);
if(SUCCEEDED(hr))
hBmp = hJpgBmp;
else
DeleteObject(hJpgBmp);
}
DeleteDC(dcScreen);
}
}
DeleteDC(hMemDC);
}
pPic->Release();
}
pstm->Release();
}
}
}
GlobalFree(hGlobal);
}
CloseHandle(hFile);
}
}
return hBmp;
}
void DrawBitmap(HDC hDC, HBITMAP hBitmap, int nXDest, int nYDest)
{
BITMAP bm;
if (GetObject(hBitmap, sizeof(bm), &bm))
{
HDC hMemDC = CreateCompatibleDC(hDC);
HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);
BitBlt(hDC, nXDest, nYDest, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
SelectObject(hMemDC, hOldBitmap);
DeleteDC(hMemDC);
}
}
void somefcn()
{
HBITMAP hBmp = LoadJpgFile(szJpgFile);
DrawBitmap(hDC, hBmp, x, y);
DeleteObject(hBmp);
}
<pre>
|
|
|
|
|
Hello,
If Unix is on the server and client has a Windows O.S then how do I get data from the server.
Which topics should I cover
Priya
|
|
|
|
|
prithaa wrote: how do I get data from the server.
Sockets or FTP are a few options.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
J2EE
|
|
|
|
|
Hello,
Thanks for your reply,
But will I be able to access database on a Unix server from my program written in MFC for Windows on the client side.
Do I need to know Unix before accessing data from a Unix server
Prithaa
|
|
|
|
|
don't mind for J2EE, i was joking.
but how are your data stored on the server ? do you have a database server ? or simple files ?
what is the medium ?
|
|
|
|
|
Hello,
It was a good joke. but I was terrified looking at those 4 letters 'J2EE'
I have a oracle database for unix.
Prithaa
|
|
|
|
|
prithaa wrote: I have a oracle database for unix.
Do you have an ODBC driver?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
prithaa wrote: But will I be able to access database on a Unix server from my program written in MFC for Windows on the client side.
Yes, of course.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello,
I don't know whether I have ODBC driver,which route should I follow in both the cases
Prithaa
|
|
|
|
|
If you do, then simply create a DSN that "points to" the Unix machine. I did this once when the target machine was Windows running Microsoft SQL. Unfortunately, it's been 6+ years ago so I've forgotten the details.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello,
Thanks for all your replies
Prithaa
|
|
|
|
|
Hi all.
I need menu in my dialog API, Sow I creat resource (Menu), whot I must do next?
|
|
|
|
|
open your dialog in the resource editor and see its properties. it has a property called Menu... choose your menu ID in the list.
that's it, the menu is now showing in your dialog.
now, if you want to add handlers on the menu items, do as if it was a button on your dialog; double click on it, or right click and choose add event handler...
|
|
|
|
|
|