|
Here's another link: Converting DDB to DIB[^]
In that code, the BITMAPINFOHEADER biPlanes, biBitCount, and biCompression members are initialized
to match the source DDB.
To change the type, set those members to the actual format you want before making the first
call to GetDIBits.
Remember, for 1, 4, and 8 bit formats you'll need to deal with a color table in the DIB.
For 24-bit, there's no color table. See the documentation for BITMAPINFOHEADER for details.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: Remember, for 1, 4, and 8 bit formats you'll need to deal with a color table in the DIB.
For 24-bit, there's no color table. See the documentation for BITMAPINFOHEADER for details.
Alright then, i will convert it to a 16 or 24 bit bitmap then. I dont want to run into complications.
Mark Salsbery wrote: Here's another link: Converting DDB to DIB[^]
Many thanx, I am once again very grateful
llp00na
|
|
|
|
|
He will need to deal with CPalette too
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
what are the basic functionality difference between this two header files???
can any one explain me in detail ???
Thanks in advance.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
I don't know about detail, but ...
wininet.h is the header file for the WinINet APIs:
"The Windows Internet (WinINet) application programming interface (API) enables applications to
interact with Gopher, FTP, and HTTP protocols to access Internet resources. "
winsock.h is the header file for the Windows Sockets 2 APIs:
"Windows Sockets 2 (Winsock) enables programmers to create advanced Internet, intranet, and other
network-capable applications to transmit application data across the wire, independent of the
network protocol being used."
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
can winsock do the functionality of WinINet?
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
You could write your own FTP/HTTP/etc. code using Windows Sockets but you'd need to thoroughly
understand those protocols. The idea of WinInet is to make that easier. WinInet is probably
using sockets for its communication.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Dear Mark,
I really appreciate your response, can you provide me any example or link of winsock
Which is used FTP/HTTP/GOPHER?. One thing more,
Winsock used any default protocol ?
Questions:
1) how the checksum play role in this socket programming.?
2) what is the difference between synchronous and asynchronous socket?
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Hi in my code i search a folder for all files it contains
WIN32_FIND_DATA pTempFind;
HANDLE hFile = FindFirstFile(m_FolderName, &pTempFind);
with the code pTempFind.cFilename you get the name of the file ? (as CString ?)
I want to get the file name in String format so i can add in my List box
|
|
|
|
|
from a reseach on google i find that i need
to convert string array to string
how i can do it in C++ ? (i only found for java :/)
|
|
|
|
|
Immunity18 wrote:
with the code pTempFind.cFilename you get the name of the file ? (as CString ?)
No, it's a TCHAR array. Why would you think it's a CString ?
Immunity18 wrote: I want to get the file name in String format so i can add in my List box
Are you sending the listbox a LB_ADDSTRING message? For example:
SendMessage(hListBox, LB_ADDSTRING, 0, (LPARAM) pTempFind.cFilename);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i have my list box variable m_List
and i add strings by m_List.AddString(str) (CString);
i had on my code m_List.AddString(pTempFind.cFilename);
and list box appear some strange letters
|
|
|
|
|
Immunity18 wrote: i have my list box variable m_List
Assuming that m_List is a CListBox object, why are you not also using CFileFind() ?
Immunity18 wrote: i had on my code m_List.AddString(pTempFind.cFilename);
What is the value of pTempFind.cFilename at this point?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I have 3 files in my folder test1 , test2 , test3
i use FindFirstFile command
and when i type m_List.AddString(pTempFind.cFilename);
Listbox appear me 'Eu|
|
|
|
|
|
But what is the value of pTempFind.cFilename at the time AddString() is called? Set a breakpoint and check the debug window.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
value is MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM i see :/ it has wrong value
my code is
m_FolderName = "C:\dsadasdxzc\";
WIN32_FIND_DATA pTempFind;
HANDLE hFile = FindFirstFile(m_FolderName, &pTempFind);
m_List.AddString(pTempFind.cFilename);
while (FindNextFile(hFile, &pTempFind))
{
m_List.AddString(pTempFind.cFilename);
}
|
|
|
|
|
Immunity18 wrote: m_FolderName = "C:\dsadasdxzc\";
Shouldn't the string literal have double backslashes?
Why are you not checking the return value of FindFirstFile() ?
Going back to what I asked earlier, why not use the CFileFind class?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Right now I'm creating a program that declares a structure, which also has enum inside it. Now I believe I declare the structure right, but the next step is to create a loop that has the user enter 5 different items of data for library information. But I have to use pointers, so when the loop runs and I enter the information, the data has to be sent to a structure variable only once all six attributes are entered, and the pointer values should be used to create the structure.
I was given an example:
cin >> a;<br />
cin >> b;<br />
library.dewey = &aptr;
This is my code so far:
struct card_catalogue
{
float dewey;<br />
string title;<br />
string author;<br />
int released;<br />
int num_pages;<br />
enum type {fiction, nonfiction, reference, pond};<br />
};<br />
<br />
int main()<br />
{ <br />
card_catalogue books;<br />
<br />
<br />
cout<< "Enter the Dewey Decimal Number please: ";<br />
cin>> books.dewey;<br />
cout<< "Enter the Title of the book please: ";<br />
getline(cin, books.title);<br />
cout<< "Enter the Author of the book please: ";<br />
getline(cin, books.author);<br />
cout<< "Enter the Year of Release please: ";<br />
cin>> books.released;<br />
cout<< "Enter the Number of Pages please: ";<br />
cin>> books.num_pages;<br />
cout<< "Enter the type: ";<br />
getline(cin, books.type);<br />
<br />
<br />
return 0;<br />
}
|
|
|
|
|
klutez123 wrote: But I have to use pointers...
Why? They are not necessary for what you are doing.
klutez123 wrote: card_catalogue books;
Should be:
card_catalogue books[5]; You then need to wrap your cout /cin statements in a for loop.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i couldn't catch what you exactly want, but can a constructor help you?
you could create a constructor that takes these values as argument and get the values one by one from console. then, create a new books struct with the values.
|
|
|
|
|
Hello!
Please, help me with such question,
how I can save BLOB object in Oracle Data Base through stored procedure?
I use vc++.
Thanks.
|
|
|
|
|
Can any one send me some sample project using TCP IP Chat project
S.Yamini
|
|
|
|
|
|
I tried to implement a chat server and client application using TCP/IP in VC++. but the connect function is not executing in client exe and accept is not executing in server exe.If u have any sample codes or links or suggestion plz send me
S.yamini
|
|
|
|
|
yaminisridaran wrote: but the connect function is not executing in client exe and accept is not executing in server exe
So, what does that mean ? That's a quite vague explanation of the problem.
yaminisridaran wrote: If u have any sample codes or links or suggestion plz send me
Did you search on codeproject for examples of socket connections ? I think there are quite a lot of articles on that subject.
|
|
|
|