|
infect i never used registry and its keys in a program.
thats why i dont know how to get UninstallPath in a program and who to run registry keys in a program.
if u give a little bit syntex and methods that are used in this procedure i will be very thank full?
and helping link about how to use registry keys in a program and how to run it?
r00d0034@yahoo.com
|
|
|
|
|
There are Windows APIs to read registries, as well as some articles here on CodeProjet. Check out RegOpenKey in MSDN for starters. Basically, you open a registry key, and you can then get data from values. Then close the key when you're done.
(I'd post some code, but I'm at my home computer at the moment and don't have any code with me. )
"Time spent with cats is never wasted." - Colette
|
|
|
|
|
hi,
My questions are:
1. How to link a MFC DLL to an exe file with DEF file
2. How to export an function without use of header file
Thanks
Extreme programming. Do the No.1
|
|
|
|
|
http://www.codeproject.com/dll/ultimate_dll_header.asp[^]
Although it's not the focus of this article, it does have a little info on .DEF files... and also a comparison of the various ways to export functions from a DLL.
Hope this helps.
"Time spent with cats is never wasted." - Colette
|
|
|
|
|
Im developing an NDIS adapter driver, to pass standard TCP/IP traffic over a nonstandard medium, and am having problems with ICMP echo request/replies. With the driver set up on 2 machines (IPs 1.2.3.4 and 1.2.3.5), I can drop to a command prompt on 1.2.3.4 and ping 1.2.3.5. An ARP is given to my driver, which is sent to the broadcast address, and 1.2.3.5 sends an ARP reply back to 1.2.3.4. An ICMP echo request is then transmitted from 1.2.3.4 to 1.2.3.5, and it is sent through my driver to 1.2.3.5. It appears to be successful in transmission, as the packet is packaged up in an NDIS_PACKET, and sent up to NDIS, and NDIS calls my MiniportReturnPacket function, however 1.2.3.5 never generates an ICMP reply. I have verified that the IPs and subnet masks are set up correctly, and that even though Im using the same driver on both machines, the MAC address's are unique. Anyone have any ideas as to what could be wrong? Thanks in advance.
Jesse Rosalia
|
|
|
|
|
Hello,
i have a bitmap in my iPAQ and i want to send with socket; my code is
int nBmpsize;
char *szBuff;
GetObject("\\Windows\\Start Menu\\front2.bmp", sizeof(BITMAP), &bitmap);
nBmpsize = bitmap.bmWidth*bitmap.bmHeight;
szBuff = new char[nBmpsize];
memcpy((void*)szBuff, bitmap.bmBits, nBmpsize);
but i have some problem. Why?
|
|
|
|
|
'some problem' does not give us much to go on. for starters, try making it an unsigned char buffer, a char buffer has a maximum value of 127. What is GetObject ? Also, bitmap.bmWidth * bitmap.bmHeight will give you the number of bits in a word aligned, one bit image ( that has only two colours ). You need to multiply by your bit depth and you need to add a stride value to the width before multiplying. My articles on Image Processing show how to calculate stride.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
The GetObject function requires a HBITMAP handle rather than the path to where the image is found. In order to get a HBITMAP handle you will need to load the image into a bitmap object. If you simply want to send the bitmap to another computer via a socket, you do not even need to load the bitmap into a HBITMAP object. This is used for displaying and manipulating the bits of the image.
All that you will need to do is open the file where the image is located, read the file data into memory, then use that memory buffer to send your image across the socket.
Here is an example:
<br />
HANDLE hFile = ::CreateFile("\\Windows\\Start Menu\\front2.bmp", GENERIC_READ, NULL, OPEN_EXISTING, 0, 0);<br />
if (INVALID_HANDLE_VALUE == hFile)<br />
{<br />
}<br />
DWORD FileSize = ::GetFileSize(hFile, NULL);<br />
BYTE *pbBuffer = new BYTE[FileSize];<br />
if (!pbBuffer)<br />
{<br />
}<br />
::ReadFile(hFile, pbBuffer, FileSize, &Bytes, 0);<br />
After you execute that code, pbBuffer will contain all of the data in the bitmap file and you can use that to send it over the socket. After you send it you will need to call delete[] pbBuffer;
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
In your example nBmpsize size may be invalid - it does not take bit depth into account, along with line alignments that may also be the case. See articles in the Code Project's Bitmap section.
Regards,
Bartosz Bien
|
|
|
|
|
if I have an url is there any function that can help me get the hostname.
E.g from http://www.microsoft.com/anypage/anypage2.html
I would like to get only www.microsoft.com part.
I could not find such an API but maybe somone knows.
Thanks in advance.
Orcun
|
|
|
|
|
One solution is a string function or algorithm to extract the sub-string you want. Do you store it in a string object or is it an array?
For a string object, use the find() functions. For an array, you could use strstr() and the like.
Kuphryn
|
|
|
|
|
I've never used it, but have a look at the InternetCrackUrl() function.
Jon Sagara
Help me out here, Spock. I don't speak stupid.
|
|
|
|
|
InternetCrackUrl() or, if you're using MFC, AfxParseURL() is a bit easier to use.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I will not lie to you. I am a Visual Basic programmer. I have been for years. However, I have been tasked with developing an autorun application for our CD publications. Naturally, this is not possible in Visual Basic because of the runtime file requirements. A post at vbexplorer.com informed me of this, and went on to say that the best way to develop such an application would be to use Visual C++.
My first response: “YUCK!”. I can be completely honest when I say that I hate C++. And even as one in the development field I strive to avoid it at all costs. I hardly understand the basics of console application (cin>>) development in it and thus realize it is going to be a monumental struggle to complete this task.
So here I am, asking, begging rather, for help. Here is what I need:
An application that:
a. Loads a form on the screen, which takes up the screens width/height parameters.
b. It must have at least the “X” close button to allow the annoyed users to bypass the autorun features.
c. It needs to have a background image, a bitmap, set to a specified file location.
d. It needs two buttons:
a. one that opens an internet location (without preference to browsers)
b. one that opens a setup exe file (location will be in same directory as the program)
e. Must be editable in Visual C++ 6.0
That’s about it. Is there any chance for help out there? Can anyone toss a quick sample together for me. That is really all that I need to take a crack at this.
In High School I had a VC++ course but it was real basic stuff. And in college I know I am credit packing my way away from having to take it. I KNOW I will need to learn it sometime, but this would sure be a big help in getting me started.
Note: Please comment; heavily, no wait, over comment it.
Thanks,
Erik J. Long
|
|
|
|
|
If you don't know cout sin stuff like that, forget about creating a win32 application( its easy) but not for a "newbie".
I would ask a pro or someone with experience to create the autorun feature.
But what your asking is fearly simple and could be created in few hours.
|
|
|
|
|
I know the basic functions of C++
cin, cout, that's nothing.
I need something to go on.
|
|
|
|
|
autorun is very easy. create a win32 app, and call the shellexecute function to the setup program on your disk. then place a autorun.ini file on the disk. if you need more the code, i can post it because it is only about 10 lines.
|
|
|
|
|
I sure can't think of any reason a program that is launched by autorun canot be written in VB. Try it and see.
Create a .exe file.
Place its name in a file named autorun.inf
Like this
[autorun]
open = MyVBApp.exe
|
|
|
|
|
Hi !
But, what about the VB Runtime DLL ? If the user don't have it installed, how will the VB App be able to launch ?
Jerome
|
|
|
|
|
That's a good point. In that case, VB won't work. Although the same is true of any other .exe that has external dependencies that might not be installed. (like common control library or an old version of the ole libs.)
Reading the post more closely, the users is simply describing a typical install program. Use the MS windows installer or InstallShield or Wise or any one of a number of other products to build such an install process.
|
|
|
|
|
Xxx.xxx is createdfile.
in autorun.ini file, write
[autorun]
open=xxx.xxx (if only xxx=exe)
ico=path(if u want to add ico)
or
[autorun]
open=start xxx.xxx(if xxx=bat,txt,...)
//start is the command of cmd.exe
|
|
|
|
|
|
Hi.
Any tutorial or help docs anywhere on how to create a simple Non MFC Win32 program that can connect to a mySQL database and show/send/delete data from the database?
Thanks for anyhelp.
|
|
|
|
|
|
My previous question was my mistake -- of course!
Now I'm setting up a Win32 app as an empty project and then adding 3 files from a game text book.
I get 1 link error:
blackbox.obj : error LNK2001: unresolved external symbol _DirectDrawCreateEx@16
Does this msg mean it can't find ddraw.lib|h?
I'm using VC 6.0 under Windows 98. The program uses directX and I have version 8.1.
I have entered ddraw.lib|h and the other directX files on
Project Settings->Link Tab->Object/library modules.
What am I doing wrong?
Al
|
|
|
|