|
How can i tile a jpeg to the background of a dialog.
thnx
Tariq
|
|
|
|
|
you shd look for some image library that give you handle or display the jpg.
-->if you looking in COM/ATL
-->look for interface IPicture
---->if you looking in RAW MFC/API
--->look for CxImage In CP,best Graphics Library present in Town
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
hello,
im looking for retreiving a pointer to a function from its name stored in a string...
thx for help.
|
|
|
|
|
hi
well so for i got ur question the function name is itself a pointer to the address space of ur program
Suppose i want to make a pointer to a ftn that return UINT and take UINT as single argument
then prototype will be like this
UINT (*p2ftn)(UINT);
p2ftn=function;
p2ftn(23);
|
|
|
|
|
i allrdy know that. and thats not what i want to do.
ex:
void myFuncNameString (void)
{
foobar();
}
void main (void)
{
char* var = "myFuncNameString";
// Here I want to call myFuncNameString only knowing the string....
|
|
|
|
|
The only way I know of, is to get the pointer to a function exported in a dll.
The C/C++ compiler takes the name of your function and translates it to an adress, no meta information is preserved when the application is compiled.
That's why we got file specifications like dll and elf, they describe a format that allows for exporting function tables.
If it's a feature you really need, then you could use a Hashtable to store pointers to your functions mapped by their name.
"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
|
|
|
|
|
hmmm...
u mean using some code like this:
typedef DWORD (*FCT_PTR)( bool pText);
struct MyStruct
{
char * name;
FCT_PTR funct;
};
const MyStruct funcHashT[] =
{
{ "foo", foo },
{ "bar", bar },
}
void foo (bool pText) { //blehbleh }
void bar (bool pText) { //blehbleh }
...
I think its ok for pure c functions, but my prob is that i need to make a new object only knowing his name (or his constructor name). same problem as above except that foo and bar are classes...
|
|
|
|
|
|
Template are out from my current knowledge but ill take a look at them asap.
But, do u think can do the following using the post i paste before:
new funcHashT[i].funct (true);
????
|
|
|
|
|
fickdb wrote:
I think its ok for pure c functions, but my prob is that i need to make a new object only knowing his name (or his constructor name). same problem as above except that foo and bar are classes...
The word you're looking for, I suppose, is Reflection. This is not possible in C++ for the same reasons as I mentioned before.
But you can of course work around the limitations, to do so requires a solid knowledge of the language and tools.
If you know, and understand, COM, you will realize that the interface IDispatch is invented for just that reason. Again, if you really need the feature, you could either use COM and IDispatch, or you could copy the technique.
What it all comes down to though, is that you're probably better of using C# for your project.
"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
|
|
|
|
|
I find a workaround:
typedef void (*FCT_PTR)( bool pText);
struct MyStruct
{
char * name;
FCT_PTR funct;
};
void wrapper_foo (bool pText) { new foo(pText); }
const MyStruct funcHashT[] =
{
{ "foo", wrapper_foo }
}
class foo
{
public:
foo(bool pBool)
{
// Code
}
}
I tested this code in a very simple c++ project and it works fine.
|
|
|
|
|
This solution should work. Nice idea
|
|
|
|
|
Hi,
How to create a GUI based application for example dialog based which will except the paramters. Actually our .exe will be called from VB application and 5 paramters are passed to that application.
Thanks in Advance.
Azghar
|
|
|
|
|
In dialog Based application in the CYourApp::InitInstance
call the function GetCommandLine and then parse the parameters
Regards
vikrant_kpr
|
|
|
|
|
hi,
I want to do Insert ,delete actions in a SQL Server Database using C++/MFC.
Can any body please tell me how to do that or give me the URLs?
thanks in advance..
|
|
|
|
|
Try reading about CRecordset, if you want to use MFC, along with CDatabase.
Alternatively, you can use ATL helper classes and use OLEDB, in which case CDataSource, CSession and CCommand/CAccessor stuff is what you want.
Steve S
Developer for hire
|
|
|
|
|
I have a old project, written by BC++4.5. Now I want to convert it to VC++, How can I do??
Thanks!
|
|
|
|
|
an activex control is about to embeded in IE,if the activeX control access the oracle ,but demands the client don't want setup oracle's client ,how to realize it ?please tell me som .thanks a lot!
|
|
|
|
|
ahh can you rephrase this question?
You're saying you have an activex control which is embedded in IE
and that the control needs access to Oracle
the user doesnt want the activex control to talk to oracle and you want to know how to tell the active x control not to use oracle?
is this correct?
Bryce
---
To paraphrase Fred Dagg - the views expressed in this post are bloody good ones.
--
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
Our kids book :The Snot Goblin
|
|
|
|
|
sorry,I scratched your head over.I revoice it now.
I have a c/s program which acess oracle .now it was demanded to insert on webe page.I decided to make a ACTIVEX control.i wish client don't need to setup oracle's client,it can download the activex and use it .but don't konw it can be realized or not.
|
|
|
|
|
Hi ,
I was planning to take the brainbench visual C++ test . Has anyone here taken it ? any suggestions or areas that they focus on . And which book do they recommend for practice ?
Thanks
|
|
|
|
|
Seriously, who cares ? What good will it do you ?
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Basically im in the process of looking for a new job and this is the company's requirement . Apart from that is there a good book that can help me prepare for this ? Ive worked with MFC for past 3 yrs but cannot say that my knowledge about MFC is complete . ive worked on a small subset of components that MFC provides .
Thanks
|
|
|
|
|
The company requires you to take the test there, or show them your result ?
Do the test, and have google in another window to look things up.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
show the result . yup thats a thought . though i d like to go over the concepts myself .
|
|
|
|