|
I think it is very simple to use GDI+ for this case,there are some article about it in CP
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
GDI+ available only in WinXP, but the standard solution talks about any of Windows systems
Philip Patrick
"Two beer or not two beer?" (Shakesbeer)
Web-site: www.saintopatrick.com
|
|
|
|
|
no,you can use GDI+ in win2000 too,it only need gdiplus.dll with installshield.
Check this
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Hmm, thanx, I read it.. Not sure why I don't have those DLLs (I have Feb 2001 PSDK installed), so I'm just downloading a last version of Platform SDK now (Nov 2001). Also I found you can download the dlls separately from here
They said that win98/NT4 is minimum... but shame on people who are still using Win95, LOL
Thanx, I'll play with it
Philip Patrick
"Two beer or not two beer?" (Shakesbeer)
Web-site: www.saintopatrick.com
|
|
|
|
|
CPropertySheetEx class has a contructor that takes HBITMAP for watermark images in WIZARD97. Just use it, that's all. Read in MSDN about Wizard97 and CPropertySheetEx
Philip Patrick
"Two beer or not two beer?" (Shakesbeer)
Web-site: www.saintopatrick.com
|
|
|
|
|
Thanks for the info, but it doesn't help me in this case, I'm creating a 'wizard like' window, and not using property sheets, so I can't make use of the built in functionality.
What I want to do is take a colour icon, and then combine it with a background to make it just appear as a white outline, like the bitmaps shown in the top right corner of a standard wizard.
Thanks
Nick
|
|
|
|
|
Is there a kind of "open source explorer" (not for net, for files!)
like the Windows-Explorer or old-school filemanager?
I tried customizing the explorer eith shell extensions, but it didn't work! Any suggests?
mfg HintiFlo
|
|
|
|
|
Yeap,here it is.
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Hi,
I am a Mechanical Engineering student.I am also very well versed incomputer programming.In fact ,I am encroaching towards Upper Intermediate Level.
After a lot of simulation programs I really want to work with real world models controlled by the computer.This is where I need help.
# I have good knowledge about 8085/8086 architecture.
# I also have sound knowledge of their instruction sets.
# I can create programs communicating through ports.
but I donot know where to begin.
? Should I use a microprocessor or a microcontroller
? How exactly should I program the mP or mC.
I know there are tools for this but the first question is still unanswered
I may be very good in software but not so conversant in hardware and stuff.So I have never connected things to my computer
So can any one of you help me get started?
Regards.
PS: let the developing language be C/C++/asm on PC
|
|
|
|
|
Wilmer kohlman wrote:
? Should I use a microprocessor or a microcontroller
? How exactly should I program the mP or mC.
What are the size/power/cost/time constraints of the project? Usually the cheapest and fastest to construct approach is to use an ordinary PC (or just the motherboard) as the controller. Custom designed boards should be used only when absolutely necessary, or if you are planning for mass production. A SBC (single board computer) is the intermediate solution between a PC and full custom design. Same principle applies to software, use standard operating systems, compilers, libraries and other tools whenever possible.
|
|
|
|
|
Hello,
A few weeks ago, I read an article here on CP that included a class that added runtime resizing and moving of controls by use of the mouse (like the resource editor in VC). I can't find the article now and was wondering if anyone recalls this article and could point me to it.
Thanks!
Todd
|
|
|
|
|
You mean this one?
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Mazy,
Actually, that was not it. But I was able to find the correct one by searching for the base class that the article covered (CRectTracker). I couldn't remember the base class until I read that article.
The acticle I was after is http://www.codeproject.com/miscctrl/controltracker.asp
Thanks for the help as it pointed me in the right direction!
Todd
|
|
|
|
|
Hello,
I'd like to suggest someone to write an article about enumerating all open TCP/UDP ports with mapping them to the owning applications under Windows XP. Unfortunately, I don't have a time for it but I've written an example on C so you could use my code
// portsenumxp.cpp (Windows XP)
//
// This example will show how you can enumerate
// all open TCP and UDP ports and map them to
// the owning application. It uses undocumented
// functions from iphlpapi.dll which were found
// by reversing netstat.exe.
//
//
// (c) 2002 Ashot Oganesyan K (ashot@protect-me.com)
// (c) 2002 SmartLine, Inc. (http://www.protect-me.com)
#include <windows.h>
#include <tchar.h>
#include <stdio.h>
#include <Iphlpapi.h>
typedef struct _MIB_TCPROW_EX
{
DWORD dwState; // MIB_TCP_STATE_*
DWORD dwLocalAddr;
DWORD dwLocalPort;
DWORD dwRemoteAddr;
DWORD dwRemotePort;
DWORD dwProcessId;
} MIB_TCPROW_EX, *PMIB_TCPROW_EX;
typedef struct _MIB_TCPTABLE_EX
{
DWORD dwNumEntries;
MIB_TCPROW_EX table[ANY_SIZE];
} MIB_TCPTABLE_EX, *PMIB_TCPTABLE_EX;
typedef struct _MIB_UDPROW_EX
{
DWORD dwLocalAddr;
DWORD dwLocalPort;
DWORD dwProcessId;
} MIB_UDPROW_EX, *PMIB_UDPROW_EX;
typedef struct _MIB_UDPTABLE_EX
{
DWORD dwNumEntries;
MIB_UDPROW_EX table[ANY_SIZE];
} MIB_UDPTABLE_EX, *PMIB_UDPTABLE_EX;
/*
DWORD
WINAPI
AllocateAndGetTcpExTableFromStack(
OUT PMIB_TCPTABLE_EX *pTcpTableEx,
IN BOOL bOrder,
IN HANDLE hAllocHeap,
IN DWORD dwAllocFlags,
IN DWORD dwProtocolVersion; // 2 - TCP, 23 - TCPv6 (size of *pTcpTableEx must be 56!)
);
*/
typedef DWORD (WINAPI *PROCALLOCATEANDGETTCPEXTABLEFROMSTACK)(PMIB_TCPTABLE_EX*,BOOL,HANDLE,DWORD,DWORD);
PROCALLOCATEANDGETTCPEXTABLEFROMSTACK lpfnAllocateAndGetTcpExTableFromStack = NULL;
/*
DWORD
WINAPI
AllocateAndGetUdpExTableFromStack(
OUT PMIB_UDPTABLE_EX *pUdpTable,
IN BOOL bOrder,
IN HANDLE hAllocHeap,
IN DWORD dwAllocFlags,
IN DWORD dwProtocolVersion; // 2 - UDP, 23 - UDPv6 (size of *pUdpTable must be 28!)
);
*/
typedef DWORD (WINAPI *PROCALLOCATEANDGETUDPEXTABLEFROMSTACK)(PMIB_UDPTABLE_EX*,BOOL,HANDLE,DWORD,DWORD);
PROCALLOCATEANDGETUDPEXTABLEFROMSTACK lpfnAllocateAndGetUdpExTableFromStack = NULL;
BOOL LoadExIpHelperProcedures(void)
{
HMODULE hModule;
hModule = LoadLibrary(_T("iphlpapi.dll"));
if (hModule == NULL)
return FALSE;
// XP and later
lpfnAllocateAndGetTcpExTableFromStack = (PROCALLOCATEANDGETTCPEXTABLEFROMSTACK)GetProcAddress(hModule,"AllocateAndGetTcpExTableFromStack");
if (lpfnAllocateAndGetTcpExTableFromStack == NULL)
return FALSE;
// XP and later
lpfnAllocateAndGetUdpExTableFromStack = (PROCALLOCATEANDGETUDPEXTABLEFROMSTACK)GetProcAddress(hModule,"AllocateAndGetUdpExTableFromStack");
if (lpfnAllocateAndGetUdpExTableFromStack == NULL)
return FALSE;
return TRUE;
}
void main(void)
{
DWORD dwLastError,
dwSize;
PMIB_TCPTABLE_EX lpBuffer = NULL;
PMIB_UDPTABLE_EX lpBuffer1 = NULL;
if (!LoadExIpHelperProcedures())
return;
dwLastError = lpfnAllocateAndGetTcpExTableFromStack(&lpBuffer,TRUE,GetProcessHeap(),0,2);
if (dwLastError == NO_ERROR)
{
printf(_T("Local IP\tLocal Port\tRemote Ip\tRemote Port\tPID\n\n"));
for (dwSize = 0; dwSize < lpBuffer->dwNumEntries; dwSize++)
{
// Local IP Address
printf(_T("%d.%d.%d.%d\t"),LOBYTE(LOWORD(lpBuffer->table[dwSize].dwLocalAddr)),HIBYTE(LOWORD(lpBuffer->table[dwSize].dwLocalAddr)),LOBYTE(HIWORD(lpBuffer->table[dwSize].dwLocalAddr)),HIBYTE(HIWORD(lpBuffer->table[dwSize].dwLocalAddr)));
// Local Port
printf(_T("%d\t"),((lpBuffer->table[dwSize].dwLocalPort & 0xFF00) >> 8) + ((lpBuffer->table[dwSize].dwLocalPort & 0x00FF) << 8));
// Remote IP Address
printf(_T("%d.%d.%d.%d\t"),LOBYTE(LOWORD(lpBuffer->table[dwSize].dwRemoteAddr)),HIBYTE(LOWORD(lpBuffer->table[dwSize].dwRemoteAddr)),LOBYTE(HIWORD(lpBuffer->table[dwSize].dwRemoteAddr)),HIBYTE(HIWORD(lpBuffer->table[dwSize].dwRemoteAddr)));
// Remote Port
if (lpBuffer->table[dwSize].dwRemoteAddr)
printf(_T("%d\t"),((lpBuffer->table[dwSize].dwRemotePort & 0xFF00) >> 8) + ((lpBuffer->table[dwSize].dwRemotePort & 0x00FF) << 8));
else
printf(_T("0\t"));
// PID
printf(_T("%lu\n"),lpBuffer->table[dwSize].dwProcessId);
}
}
dwLastError = lpfnAllocateAndGetUdpExTableFromStack(&lpBuffer1,TRUE,GetProcessHeap(),0,2);
if (dwLastError == NO_ERROR)
{
printf(_T("Local IP\tLocal Port\tPID\n\n"));
for (dwSize = 0; dwSize < lpBuffer1->dwNumEntries; dwSize++)
{
// Local IP Address
printf(_T("%d.%d.%d.%d\t"),LOBYTE(LOWORD(lpBuffer1->table[dwSize].dwLocalAddr)),HIBYTE(LOWORD(lpBuffer1->table[dwSize].dwLocalAddr)),LOBYTE(HIWORD(lpBuffer1->table[dwSize].dwLocalAddr)),HIBYTE(HIWORD(lpBuffer1->table[dwSize].dwLocalAddr)));
// Local Port
printf(_T("%d\t"),((lpBuffer1->table[dwSize].dwLocalPort & 0xFF00) >> 8) + ((lpBuffer1->table[dwSize].dwLocalPort & 0x00FF) << 8));
// PID
printf(_T("%lu\n"),lpBuffer1->table[dwSize].dwProcessId);
}
}
if (lpBuffer)
HeapFree(GetProcessHeap(),0,lpBuffer);
if (lpBuffer1)
HeapFree(GetProcessHeap(),0,lpBuffer1);
}
|
|
|
|
|
hi,
I have been trying to find a source code that will generated a barcode from a membership ID number and also be able to read this barcode to call up the mmembers details from a database, does any body know were i could find something like this.
thanks for any possible info about this.
|
|
|
|
|
There are many different standards for barcodes. Do you want EAN-13? There are also many different ways to generate barcodes. One of the simplest would be to download (or make) a barcode font.
Anyway, here is a place to start:
http://www.makebarcode.com/stdorg/orgs.html
They have some general information to help you find the best solution for you.
/moliate
|
|
|
|
|
There was a project posted here not to long ago. It was a demo of a space invaders like game. But now I can't seem to find it. I was ranked pretty high.
|
|
|
|
|
|
I would like to request an article that explains how to send a file (binary) over a winsock tcp connection. (MFC)
Kuniva
--------------------------------------------
God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.
|
|
|
|
|
Kuniva,
Please see the attached sample code of a Winsock client. With a little bit of improvisation and MFC socket programming knowledge you could easily change it to your needs.
/***************************************/
/* This is the sample code for a client that send and receives some data from a server.*/
DownloadFileFromInternet(CString strAddress)
{
char buff[1024];
int s;
struct sockaddr_in a;
struct hostent *h;
WSADATA wsaData;
int SERVER_PORT = 1223;// The server port to which the client will connect.
// This call initializes the Winsock.dll
WSAStartup(0x101, &wsaData);
// Initializing the sockaddr_in datastructer with all zeroes.
memset(&a,0,sizeof(a));
// First assume an Internet dotted form address e.g. 198.168.0.1
a.sin_family = AF_INET;
a.sin_port = htons(SERVER_PORT); // Connect to the server port
a.sin_addr.s_addr = inet_addr("127.0.0.1"); // Connect to the localhost. Replace this address with the IP address of the server.
/////////////////////////////////////////////
// You may use descriptive Internet (e.g. www.microsoft.com) instead of the dotted (e.g. 127.0.0.1) one.
h = gethostbyname("www.microsoft.com"); // change this address to the desired server's address.
if (h != NULL)
{
a.sin_addr.s_addr = ((LPIN_ADDR)h->h_addr)->s_addr;
}
else
{
AfxMessageBox("Cannot resolve hostname\n");
WSACleanup();
return FALSE;
}
// create the socket.
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (s == 0)
{
AfxMessageBox("Cannot establish connection: ");
WSACleanup(); // Winsock.dll cleanup code
return FALSE;
}
// socket succesfully created, now we may connect to the server
if (connect(s, (struct sockaddr *)&a, sizeof(a)))
{
//Can not establish the connection to the server
WSACleanup();
return FALSE;
}
// Connection established with the server. Start receiving data from the server
int k=0;
k = recv(s, buff, 1024, 0);
if (k<0)
{
// An error occurred while trying to receive data
closesocket(s); // close the opened socket.
WSACleanup(); // clean up Winsock.dll
return FALSE;
}
buff[k] = '\0';
// we will NULL terminate the received data from the server.
// We will send "WA-ALIKUMASALAM" to the server.
k=0;
while (k < int(strlen("WA-ALIKUMASALAM")))
{ // keep sending until all the data is sent.
k = send(s,"WA-ALIKUMASALAM",strlen("WA-ALIKUMASALAM"),0);
}
// We are finished. Now its time to close the socket
closesocket(s);
return TRUE;
}
/*****************************************/
Software Engineer (Techlogix (pvt)ltd)
Visiting Faculty Informatics, Lahore
|
|
|
|
|
Thought I would try something different in the requests here.
Basically we need to show to a client that a web interface can be pretty damned "spiffy" and very interactive. They think that ALL web interfaces are like Amazon or Yahoo.
Now I could write my own interface with real-time alerts, videos, animations and all the bells and whistles (including a moving graph), but that would be a big waste of money if they turned around and said "no, we are dropping the project."
I know the first response to this will be a Flash interface, but we want to also find a good non-flash, DHTML-using interface.
So does anyone have any links to games like this? Preferably related to stock markets, buying shares etc.
thanks in advance
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
"The greatest thing you will ever learn is to love, and be loved in return" - Moulin Rouge
Martin Marvinski wrote:
Unfortunatly Deep Throat isn't my cup of tea
Do you Sonork? I do! 100.9903 Stormfront
|
|
|
|
|
Probably not exactly what you want but pretty impressive IMO DHTML page is http://www.htmlguru.com/. I don't like the usability of the interface and graphics not the best, but it looks pretty cool for pure DHTML.
|
|
|
|
|
It seems like the writers at MicroSoft just love VB, and any example that does anything that comes near to getting my interest is done in VB, when I would love to see it in VC or C#. So, does anyone have a C# or VC++ example of the following :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet10142001.asp
|
|
|
|
|
I want to make a DLL with a dialog that I can call from my app. Can anyone give me a basic example of how to do this? I would like a a DLL source that just launches a dialog on a call from a basic program. Or can someone give me tips on how to do this? I have found the articles here do not focus on the basics of DLLs. Thanks if you can help.
- Matt Newman
- Matt Newman
-Sonork ID: 100.11179:BestSnowman
|
|
|
|
|
I am not sure if this is what you wanted, but to create a dll in VC5 all you have to do is this:
Create a new win32 dll project (empty).
Create a .h and .c file like this:
/////////////////////////////////////////////////////////////////////
// File quicktest.h
/////////////////////////////////////////////////////////////////////
#ifndef _WINDOWS_
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
/////////////////////////////////////////////////////////////////////
#ifdef _cplusplus
extern "C"
{
#endif
/////////////////////////////////////////////////////////////////////
void WINAPI SomeFunc(PSTR someText);
/////////////////////////////////////////////////////////////////////
#ifdef _cplusplus
}
#endif
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
// File quicktest.c
/////////////////////////////////////////////////////////////////////
void WINAPI SomeFunc(PSTR someText)
{
MessageBox(GetDesktopWindow(), someText, TEXT("Some title"), MB_OK);
}// someText()
/////////////////////////////////////////////////////////////////////
And while those files are cooking, you take a new file and call it something like: quicktest.def, and put in something like this:
LIBRARY quicktest
DESCRIPTION 'Some functions for blah blah'
EXPORTS
SomeFunc @1
Then you press compile, and voila!, a dll...
Jan
"It could have been worse, it could have been ME!"
|
|
|
|
|