|
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
|
|
|
|
|
i need help in the header files coz i am not sure about it. i have: cart.h clerk.h shopper.h wallet.h
i will call the wallet.h and cart.h in the shopper.h as they r part of him. i just wanted to put on the right track.
thanks,
|
|
|
|
|
I need to do something about Java now.
I know a lots MFC programmers use Java also.
I hope to find good and very popular Java forums first.
thanks for links to those Java forums.
includeh10
|
|
|
|
|
Does any one know how to prevent a window from restoring when double clicking on the title bar ?????
|
|
|
|
|
|
I'd like to start studying Win32 programming. Do you know any websites containing good material for beginners and advanced programmers? Thank you!
modified 9-Mar-17 17:25pm.
|
|
|
|
|
like msdn.microsoft.com[^] ?
I would also recommend Petzold's book "Programming Windows".
btw Codeproject is good resource for Win32 programming, too.
best regards
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|