|
Most likely you have left some missing call to Func1() when you decided to switch to dynamic linking. Remember now all calls to this functions must be thru the pointer pFunc . You have two options:
- Globally replace all calls to
Func1() with appropriate calls to the pointer,
- write a little wrapper named
Func1 that internally uses the pointer.
Ellaborating on the second solution, you can even consider doing what's called lazy initialization and load the function only when first needed, like this:
DWORD Func1(DWORD dw,char* pch)
{
static SQRTPROC* pFunc=(SQRTPROC*)::GetProcAddress(hInstance, "Func1");
return (*pFunc)(dw,pch);
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you !
I realy have left some missing call to Func1() .
Now it passed compilation successfully.
But I have a new problem with it .
I send it in a new thread.
|
|
|
|
|
I want to write a VC++ program, that can delete some file in system folder like: C:\\windows\\temporary internet files\0
I use some code like that
SHFILEOPSTRUCT sh;
sh.hwnd = GetSafeHwnd();
sh.wFunc = FO_DELETE;
sh.pFrom = "c:\\windows\\temporary internet files\\*.gif\0";
sh.pTo = NULL;
sh.fFlags = FOF_NOCONFIRMATION | FOF_SILENT;
sh.hNameMappings = 0;
sh.lpszProgressTitle = NULL;
SHFileOperation (&sh);
But happens a error: can not delete file : file system error (1026)
Default Internet Explore is IE. When I use Netscape like default I can delete some files!
Any ideas?
Thank you!
|
|
|
|
|
I'm not sure about this but if IE makes the files unwrite able (write protected) the files perhaps wont be deleted. I don't know the SHFileOperation() func so much so I can give you a direct answer!
See if it is like I said!
------------------------------
©0d3 ©®4©k3® - That's me!
------------------------------
|
|
|
|
|
There are no files in Temporary internet files. Look at it in a DOS box to see. There are several subdirs under that that actually have the files.
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
Hi,
i would like to build a program to make plays for american football. i'm looking for a convenient way to loop through the play.
Every 50 msec, i would update the positions of the players. the players would be in a database and contain all different kinds of attributes like speed, strength. Speed would be for instance: he runs 40 yards in 4.8 seconds.
This means 8.33 yards in 1 second, leading to 0.41667 yards in 50 msec.
(correct me if i'm wrong)
So with the appropriate interval (50 msec?) and conveniently chosen coordinate system, calculating & plotting the new position should be pretty easy? (players will run along a route that can be drawn)
What's the easiest way to translate this info in a new position on screen of that player?
Do i change the screen coordinates in centimeter of feet (doesn't really matter for me if it's metric or not, it's the method that counts)?
Another thing i would like to add later on is acceleration. For instance,
it takes player x 1.2 seconds or 10 yards to reach his full speed.
Any ideas on that?
Any links to articles on these kinds of problems are also welcome.
Thanks for any info!
|
|
|
|
|
Hi,
I have written a code in VC++ to solve a puzzle.We need to integerate this with our educational site.This site is developed on Oracle8,ASP and VB.Please could you help me how to do it.
|
|
|
|
|
Maybe you can turn your VC++ program into a COM object so that VB could use it. Maybe a simple non-mfc dll will do the trick.
|
|
|
|
|
Hi,
Thanx!
But i am a beginer and i am not familiar with COM and could you please elaborate more on that non-mfc dll.
Bye
|
|
|
|
|
Sorry, it is not a non-mfc dll. It is a MFC regular DLL.
A regular DLL can be linked to MFC dynamically or statically. It uses MFC internally and the functions
it exports can be called by either MFC or non-MFC executables. The client program can be written in any
language that supports the use of DLLs (C, C++, Pascal, Visual Basic, etc.); it need not be an MFC
MFC application. Please refer to MSDN documentation for further details.
|
|
|
|
|
A non-MFC DLL is a DLL that does not use MFC internally, and the functions it export can be called by either MFC or non-MFC programs. Functions are usually exported from a non-MFC DLL using the standard C interface.
Since your program is in VC++, you might want to try MFC regular DLLs.
A regular DLL uses MFC internally and the functions
it exports can be called by either MFC or non-MFC executables. The client program can be written in any
language that supports the use of DLLs (C, C++, Pascal, Visual Basic, etc.); it need not be an MFC
MFC application. A regualr dll cannot export MFC objects. Please refer to MSDN documentation for further details.
|
|
|
|
|
Hi VC Student
I wrote a simple project by MFC dialog based exe.
Now i want to write it again in .DLL in VC++.
Our Delphi programmer could use of my DLL, only by LoadLibrary function ...
Can you tell me how could i do it, please ?
First problem is, Because LoadLibrary can load functions from DLL.
And in MFC i used classes !
Second problem is, I heard other programming languages like Delphi cannot use the MFC DLL extension ...
Could you tell me how can i do that ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi! all,
How we can determine programatically whether the system is in DOS Mode(Full Screen) or Windows Mode, using WIN32 programming supporting OS from Win95 to WinXP? Thanx in advance..
Debabrata.
Debabrata Debnath
India
|
|
|
|
|
The following functions may be of use :-
GetConsoleScreenBufferInfo
GetLargestConsoleWindowSize
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
how to deal with taskbar programmatically?
such as add or delete item from it,hide or how it,and so on.thanks
|
|
|
|
|
Hi everybody,
For my application, i need to calibrate some parameters, some technical articles explain that i should use a minimization method which is called Levenberg-Marquart method. I show an explanation coming from numerical recipes in c, but i don't have the book with all the library i will need. And, as i'm not a specialist in this kind of code, i'm not sure that i understand all the code given in the article. So, i would like to know if someone could help me to understand the code;
thanks in advance
gerald
|
|
|
|
|
I want to monitor a RAS connection (received and send bytes). I try with CRasMonitor but it not work in w2k.
misu
|
|
|
|
|
i m jus a beginner to VC++
how can i create a new childframe to display a new document under MDI?..take for instance a button 'process' located at the toolbar so that when i click on it, a new childframe containing the document i desired will appear.
pls help mi on this simple problem. thanks to all experts out there
|
|
|
|
|
You should be able to locate a document template pointer in the CYourApp class of your MFC project (I assume its MFC your using). What I do is have the CMainFrame contain a member variable which is a document template pointer type, and when the CYourApp starts and it creates the CMainFrame, I have the MainFrame template variable = the newly created template pointer. This gives you instant, easy access to the template without having to iterate through all the document templates in the CYourApp class, and also gives you much easier access to doing what you want (the pointer is deleted by the document template system so you don`t need to worry about deleting it or memory leaks either!). This template can be used to create a new document and a new child window using the following code :
void CMainFrame::NewChild()
{
CMyDoc* pMyDoc = (CMyDoc*)pTemplate->CreateNewDocument(NULL);
CMyWnd* pMyWnd = pTemplate->CreateNewFrame(pMyDoc, this);
pTemplate->InitialUpdateFrame(pMyDoc, pMyFrame, TRUE);
}
Hope this helps,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
dear Mr Alan
thanks a lot for your great help
but since i am a beginner to this..i am not too sure of the docu template pointer u refer to.
when i compile, how should i declare my pTemplate as?
is this pTemplate u refer to as the docu Template pointer?
wat should i put for the variable type for pTemplate?
would appreciate if u haf a copy of source code to refer to me. (kiplier@hotmail.com)
thousand thanks
|
|
|
|
|
OK, the code you should refer to is in the InitInstance function of your CYourApp class (where CYourApp is the class that encapsulates your whole application and its name depends on what you set it too), and it looks like this :
CMultiDocTemplate* pDocTemplate;
pTemplate = new CMultiDocTemplate(
IDR_YOUR_MENU,
RUNTIME_CLASS(CYourDoc),
RUNTIME_CLASS(CYourFrame),
RUNTIME_CLASS(CYourView));
AddDocTemplate(pTemplate);
CMainFrame* pMainWnd = new CMainFrame;
...
m_pMainFrame = pMainFrame;
m_pMainFrame->m_pTemplate = pTemplate;
when i compile, how should i declare my pTemplate as?
you declare your pTemplate as a CMultiDocTemplate*.
is this pTemplate u refer to as the docu Template pointer?
Yes.
wat should i put for the variable type for pTemplate?
the variable type is a CMultiDocTemplate*
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
how to change the keyboard's Num Lock status programmatically?
|
|
|
|
|
take a look at SetKeyboardState
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
The documentation for SetKeyboardState() correctly says that you cannot use this API to toggle the NUM LOCK, CAPS LOCK, and SCROLL LOCK keys.
|
|
|
|
|
You read it wrong friend.
What the documentation says is that the indicator lights won't get turned on/off, but the states DO CHANGE for the calling thread.
[snip]
Because the SetKeyboardState function alters the input state of the calling thread and not the global input state of the system, an application cannot use SetKeyboardState to set the num lock, caps lock, or scroll lock indicator lights on the keyboard
[/snip]
Regards
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|