|
includeh10 wrote:
any idea to create a serch engine in c++ for web-pages?
yeah that very simple,
you have read Webpages for keywords,meta tag etc. and store them in your database.
and rest ithink you know
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
hain buddy,
buddy but Searching are done on based on Internet Files only naa
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hi experts,
I found a really easy example on how to create a dll to hook the open/save dialogs to customize, but it says to "call it from VB", but I don't have Visual Basic installed, I'm using VC++ 6.
How do I create a simple application to test the dll in VC++? I've tried all the tutorials here which all work great for those examples, and searched forever on Google, but I keep getting errors no matter what I try for this particular project.
I'm a real c++ newbie, please help, I'd be so grateful.
|
|
|
|
|
Hi Buddy,
you can call that DLL Function By two Ways
#1 Via using LoadLibrary %GetProcAddress Func
#2 including the headr file and Libaray file in your project and directly calling function.
UnderStand ,i Don't think so.
here is example for both using your's iPong.dll
#1 Using LoadLibaray
Declare Function in your calling Client
typedef BOOL (WINAPI *MYOPENFILENAME)(HWND, LPTSTR, LPTSTR);<br />
<br />
typedef BOOL (WINAPI *MYGETSAVEFILENAME)(HWND, LPTSTR, LPTSTR);
Now use LoadLibrary function to Dynamic Load Libaray
MYOPENFILENAME myFunc1;<br />
<br />
HMODULE hPong=::LoadLibrary("ipong.dll");<br />
<br />
if(hPong)<br />
{<br />
myFunc1=(MYOPENFILENAME)::GetProcAddress(hPong,"MyGetOpenFileName");<br />
<br />
if(myFunc1)<br />
{<br />
(myFunc1)();<br />
<br />
}<br />
<br />
}
i think our method is little tough for Beginner you can try second method it's little easy.
#2 modify the code of IPong add a header file Ipong.h
and add these two function to it
BOOL __stdcall MyGetOpenFileName(HWND, LPTSTR, LPTSTR);<br />
BOOL __stdcall MyGetSaveFileName(HWND, LPTSTR, LPTSTR);
and add this header file to ipong.cpp
#include "stdafx.h"
#include "resource.h"
#include "ipong.h"
now recompile and again make dll.
now copy ipong.h,ipong.lib into you calling client Sourec code and use them as simple function.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Thank you very much for taking the time to look at the example and offering help I appreciate it so much . Unfortunately, I can't seem to get it to work, however thanks to your examples I can now load the library file following both examples. I just don't know how to return the MyGetOpenFileName?
I tried creating a simple application as console to return that the library loaded, and I've tried a dialog based app. Ugh! I'm such a newbie, I don't get what function needs to be added so that the dll is hooking the dialog box? Any ideas - I hope I make sense?
Thank-you once again.
|
|
|
|
|
Hello ,
Really i can't Understand what you want to say.
i am sorry.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I'm sorry I did not make my self clear Thanks for looking again. First I'm trying to learn how to do this from step one, eventually I'd like this dll to be part of a system process.
For example, after trying to do this on my own with a simple console application and failed, I tried to add ipong in an example app I found here. But I don't know how to return function MyGetOpenFileName(); or if I use your first example (myFunc1)(); ?
<br />
if(myFunc1)<br />
{<br />
(myFunc1)();<br />
}<br />
Any pointers? I feel so stupid for asking, I searched Google to help me find an answer but I don't understand how to do it in this project?
Kind Regards.
|
|
|
|
|
mjeb Brother if you don't mind,i amlittle busy these day can you give me thre or four day to solve your problem
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
mjeb Brother if you don't mind,i amlittle busy these day can you give me thre or four day to solve your problem
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
I don't mind at all Please don't feel the need to help unless you have the time, I'm already extremely grateful that you responded to my query
If you do post again and I find the solution before then, I promise to let you know. Thank-you once again.
|
|
|
|
|
Here you are:
#include <windows.h>
typedef BOOL (__stdcall * MYGETOPENFILENAME)(HWND ghWnd, LPTSTR szName,
LPTSTR szInitDir);
MYGETOPENFILENAME MyGetOpenFileName;
static void ShowLastError()
{
LPVOID lpMsgBuf;
if (!FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0,
NULL ))
{
return;
}
MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONERROR );
LocalFree( lpMsgBuf );
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nShowCmd)
{
TCHAR filename[MAX_PATH];
HMODULE hDll = LoadLibrary(TEXT("ipong.dll"));
if (NULL != hDll)
{
MyGetOpenFileName = (MYGETOPENFILENAME) GetProcAddress(hDll, TEXT("MyGetOpenFileName"));
if (NULL != MyGetOpenFileName)
{
lstrcpy(filename, TEXT("test.txt"));
if(MyGetOpenFileName(NULL, filename, TEXT("C:\\")))
{
MessageBox(NULL, filename, TEXT("Testing"), MB_OK);
}
}
else
{
ShowLastError();
}
FreeLibrary(hDll);
}
else
{
ShowLastError();
}
return 0;
}
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
Wow, you are too kind Thank-you very much, I've been at this for days, you should see the codes I came up with Aaah!
I'm learning more though, I just learned yesterday that the WINAPI in the typedef should of been __stdcall like your code does, my progress was as far as error checking the code up until MyGetSaveFileName. I couldn't get the function FileOpenHookProc to return.
However besides reading all the DLL articles I could find, I found one nice little program to help my progress. Maybe others will like it too. This is my first attempt at a project aside from "Hello World"
Once again, thank-you your code works perfectly and the comments were an excellent helper!
Many Many Regards
|
|
|
|
|
How can I get the height of a given font (or one, which has yet to be created) in PIXELS (not in points and not in logical units)?
Another question in the same direction: where do I find the "DPI setting" of the monitor? I don't mean the physical setting but the one in the Display Properties, Settings, Advanced (the term "DPI" is used incorrectly in this context, but that's how Microsoft named it).
|
|
|
|
|
|
Thanks Mike, that solved my problem.
|
|
|
|
|
Hello all,
I am new to C++. I have a question. I use inheritance the base class is: Shape, I want to draw a circle. So I have to have a class Point too. My question is how do I print out a CHar at a specific position in DOS screen.
In order to draw a Circle. I have to draw a point. I use a CHAR to draw. Please help.
Thanks a lot
|
|
|
|
|
Hi.
There is more than one functions to move cursor on Dos Screen.
the simplest function is gotoxy(x,y).
try it .
On Earth nothing impossible,
while your mind running.
Faroqtam
|
|
|
|
|
Thanks for your help. I solved the problem
|
|
|
|
|
if you looking for Graphics.
there are many function described in graphics.h
Some are---
--outtextxy for printing Text on Screen
--Rectangle,Bar for drawing Rectangle,Squre etc.
i amnot touch with Dos based C++ for year's,you can refer more function in Grahics.h Help in TurboC++.
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
|
Cuu wrote:
Hi ThatsAlok
Love
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Cuu wrote:
My question is how do I print out a CHar at a specific position in DOS screen.
These three come to mind:
cout
printf()
WriteConsole() (preceded by a call to <code>SetConsoleCursorPosition()</code>)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
*first time to use classes and i need help to do this plz*
Imagine that you are ready to go shopping. You remember your list of items to buy, place some money in your wallet, and off you go. Once you have parked the car away from the loose carts in the lot, you stroll into the store, grab a cart of your own, and head toward your listed items. When you have finished selecting your stuff, you find the shortest checkout line. What happens next? You wheel the cart into the checkout area, and the clerk removes the items one at a time and scans them through the register. The clerk tells you the total cost of your purchases. You reach into your wallet and (assuming you have enough money) give the clerk the balance due, get the bags, and leave the store.
Now we need to think about a program design that models this shopping scenario. What are all the real-world objects? There is a shopper. There is a checkout clerk. The shopper has a wallet. There is also a shopping cart. And there are items that the shopper wants to buy.
How are all these objects related? The shopper has a wallet. The shopper interacts with (uses a) checkout clerk. These relationships are fairly obvious. However, the relationship between the shopper and the shopping cart is not so clear. (Remember, in a has a relationship, the object is an integral part of the containing object, whereas in the uses a relationship, the second object provides a service to the first object.) The shopper uses a cart (true enough). We can argue that the shopper must carry his or her items and the cart does this task for the shopper; therefore, the cart is an integral part of the shopper.
The Cart class can now be started. Assuming a Cart object is capable of holding up to 10 Items. The software cart also needs to keep track of how many items it contains and to have the ability to add an item into the stuff array. Also, because the data is private, we need to access the array of items. The cart should be smart enough to calculate the price of the items it holds at any point of time. Shoppers can add or return items out of his shopping carte before he checks out.
Shopper reads the items from a data file called StuffToBuy.dat. This file contains the item name, price, and quantity.
For example, our Shopper might have a list that looks like the one here:
whole wheat bread 1.99 2
vanilla Ice cream 4.59 1
honey 2.69 1
apples 0.25 6
decaf coffee 5.99 1
When the items are placed in the Cart and checked out, each item (whether the Shopper purchased one or many) is treated as a single item. Add the ability for the Clerk to report the item name and price as the items are scanned during the checkout procedure. Also, have the Clerk add a 5 percent sales tax to the total purchase amount and report the number of items scanned. The Shopper should write out the amount of money in his or her wallet before and after the shopping experience. Clerk should be able to calculate the total amount he has at any point of time and should be able to check the store’s stock at any point of time as well.
|
|
|
|
|
Your homework looks lovely. If you want people to do it for you ( and therefore to fail your exams ), go to rentacoder.com, I'll be happy to bid on it there. If you want help, try to do your own homework, and post here when you get stuck.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
umm first its not a homework...its a home work of another section as there r two sections i'm in the other one. and i jst wanna know how to do it. and compare it to mine. but thx anyway
|
|
|
|
|