|
|
Priyank Bolia wrote:
...but not good
Why? This is the method I've used in years past. I find it easier to read than a bunch of pointers ands casts.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I just write that thinking that people like it or not. I still use it in imaging programs, where image documents are large size and memory and speed are a constraint. It saves memory and helps out small programmers from the pointers nightmare, and the main point is it will save precious time as compare to for loops and memcpy operations etc.
http://www.priyank.in/
|
|
|
|
|
hello,
how can I compare two HTML files and know if there text contents has changed and highlight the changed parts.
|
|
|
|
|
google for beyond compare
|
|
|
|
|
I have many shared printers on my windows network. I want to use the API function StartDoc to initialize a print job. How can I get to know the HDC of every printer I have access to. Thank you.
modified 9-Mar-17 17:22pm.
|
|
|
|
|
Hi all,
I'm working on an MFC based application dealing with EN_CHANGE events. In my program, the user has to enter a parameter in a Edit Box, that starts an events:
void CExcitaPage::OnEnChangeAmplitude()
{
//Event...
}
I need to disable this event to configure the program first. Does someone can help me?
NikoiD.
|
|
|
|
|
Are you saying that OnEnChangeAmplitude() is being called when the dialog is first displayed, rather than just when the user makes a change? If so, try:
class CExcitaPage : public CDialog
{
private:
bool m_bInitializing;
};
CExcitaPage::CExcitaPage()
{
m_bInitializing = true;
}
BOOL CExcitaPage::OnInitDialog()
{
CDialog::OnInitDialog();
m_Amplitude.SetWindow(...);
m_bInitializing = false;
return TRUE;
}
void CExcitaPage::OnEnChangeAmplitude()
{
if (! m_bInitializing)
{
}
}
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Use a flag that is set to false when your app starts and is set to true once your program is configured. Check this flag in the EN_CHANGE handler.
void CExcitaPage::OnEnChangeAmplitude()
{
if (m_bIsPageInitialized)
{
}
}
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Hi PJ Arends,
Thank you for your answer! I already tryed our solution, but for a reason that I can't determine, the program crashes because of the declaration of my variable. In the class related to my program's page, I declare as public variable:
<br />
public:<br />
int Configured;<br />
and then I initialize to zero this variable before the configuration. Afterthat I set the variable to one and check in in my handler like that:
<br />
<br />
void CExcitaPage::OnEnChangeAmplitude()<br />
{ <br />
if (Configured) <br />
{ <br />
}<br />
}<br />
When I try to close the program, I become a classic Debug Error, Damage Block...
Do you have an other idea?
Thank you in advance
NikoiD.
|
|
|
|
|
You obviously have other errors in your program. I use this technique frequently if no problems. The debugger's error messages will usually give you a clue as to where the error is, although some detective work may be necessary.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Hi,
I am trying to use 'LoadLibrary()' & 'GetProcAddress()' functions to call the following function :
'D3DXCreateTextureFromFile(...)'
Now, this function is typedefed in 'd3dx8tex.h' as
#ifdef UNICODE<br />
#define D3DXCreateTextureFromFile 3DXCreateTextureFromFileW<br />
#else<br />
#define D3DXCreateTextureFromFile 3DXCreateTextureFromFileA<br />
#endif
So I wrote the following piece of code in my prog hoping to get things running at runtime...
################################################<br />
<br />
.<br />
.<br />
.<br />
<br />
typedef HRESULT (WINAPI *PFTEXT) (LPDIRECT3DDEVICE8, LPCSTR,LPDIRECT3DTEXTURE8*);<br />
<br />
HINSTANCE hLib1;<br />
PFTEXT pfText1;<br />
<br />
hLib1 = LoadLibrary("D3D8.DLL");<br />
<br />
if(hLib1 == NULL)<br />
return false;<br />
<br />
pfText1 = (PFTEXT) GetProcAddress hLib1,"D3DXCreateTextureFromFileA");<br />
<br />
if(pfText1 == NULL)<br />
{<br />
FreeLibrary(hLib1);<br />
return false;<br />
}<br />
<br />
if(FAILED(pfText1( m_pD3DDevice,szTextureFilePath,&m_pTexture)))<br />
{<br />
FreeLibrary(hLib1);<br />
return false;<br />
}<br />
<br />
FreeLibrary(hLib1);<br />
return true;<br />
<br />
.<br />
.<br />
.<br />
<br />
################################################
though it seems a working code it is not running properly giving NULL in 'pfText1' ie the function is not getting located from DLL. Also i think ( ) that there is a problem in DLL itself ie i am not able to find out where this function is defined (in which DLL). Please help me get this thing to work...
thxx.
gogizmo
|
|
|
|
|
its easier to put into the include directive in afx.h
Its better to use apparently the AfxLoadLibrary
heres a link for load library
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_link_explicitly.asp[^]
save your self trouble and type
#include <D3DX8.h>
at the top. make sure in tools->options->projects you have the paths linked up.
Building and executing a D3D sample will let you know.
my 2 cents from my experience, but I am in know an expert at c++
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
has anyone seen code that finds mersenne prime numbers???
|
|
|
|
|
Google for the GIMPS project. I was going to refer you to the Mersenne site but it is currently down.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
how can i find out the information about my computers processor like - Manufacturer, Clock Speed etc.
|
|
|
|
|
Try the Win32_Processor WMI class.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
and...how do i do that.....im pretty new to c++
|
|
|
|
|
WMI is a tall order to tackle if you are not that familar with C++ and COM. You might want to use the performance counters first to get the feel of things. See my example here.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
can i find out through code, the amout of processing power my application is using.
|
|
|
|
|
See if this helps.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
has anyone come across a matghematical equation or something similar which when executed on a computer takes a lot of time. something like umm....trying out all the possible combinations of a 14 character password.
|
|
|
|
|
uhm, this should do it
void main()
{
int i = 0;
while ( true )
{
i++;
}
}
Chris Meech
I am Canadian. [heard in a local bar]
Remember that in Texas, Gun Control is hitting what you aim at. [Richard Stringer]
Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
|
|
|
|
|
not something so simple....id like something more complex
|
|
|
|