|
|
I have a simple qestion that when we make a function
inline then the code should be embeddede in the main
function and we should not have any call done to the
function .
But actully in VC++ this dont happen pls try the
example , and let me know that if am missing to set
any compiler flag .
In VC++ __forceinline is used to force inline function
by passing the cost/benefit analysis .I have tried that
also but it dont work .
To test the code just go to the disassembly and if u
find any assembly instruction as "call" then the inline
mechanism is not implement by ur vc compiler .
Thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
because you certainly don't write it correctly...
you can either put the code directly in the member functions in the class definition (not recommended though) or use the inline keyword in the implementation file...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Sir u can try this
<br />
__forceinline swap1(int p, int q)<br />
{<br />
<br />
<br />
p+=q;<br />
q=p-q;<br />
p-=q;<br />
}<br />
<br />
void main()<br />
{<br />
<br />
register int a=2,b=4;<br />
swap1(a,b);<br />
<br />
}<br />
<br />
This is a simple console applicaition , if u find anything
wrong in this ur are welcome .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
I know that that why i have used the
__forceinline keyword provided by MSVS
for forcing an function to be inline .
This means that if i want to optimise my
code but some stupid compiler formulas
says its not going to be optimise it rejects
my reqest. Why the hell is it intorduced in
the language.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
I have gone throught the link ,
but it tells me to set the compiler option
" you must set the /Ob compiler option to 1 or 2"
How to do the option setting for complier can u tell me .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
I'm looking for a code to perform a fast search in a table or array. I knowed it like binary search. The file are is in secuential order. Thank
|
|
|
|
|
Use the bsearch function in the CRT.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
What do you mead when say CRT?
|
|
|
|
|
CRT - C Runtime Library
It's the standard set of C functions.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
You can also use the STL's binary_search: http://www.sgi.com/tech/stl/binary_search.html
Matt Godbolt
Engineer, ProFactor Software
StyleManager project
|
|
|
|
|
Hi All,
Requirement: i want to print the table in an MS Access Database.The Design is such that when i select a database using open Dialog, the corresponding tables in it should come in combo box automatically,i.e,
1) I should be able to retrieve the no. of tables & their names as well(not resolved)
2)on selecting any 1 table in combo box, i want to automate its printing through the click of a button.
i am using vc++ 6.0 & office 2000
Where i am: I tried a lot & searched a lot on net. a lot of material is available in vb/.net but in vc++ the same approach doesn't work out. Here is a snippet of the code:
if(!app.CreateDispatch("Access.Application"))
{
AfxMessageBox("Couldn't CreateDispatch on Excel");
return;
}
// Set visible.
app.SetVisible(TRUE);
app.OpenCurrentDatabase(m_FileName,TRUE);
//Get DoCmd Collection
lpDisp=app.GetDoCmd();
ASSERT(lpDisp);
// Attach the IDispatch pointer to the oDoCmd object
oDoCmd.AttachDispatch( lpDisp );
//Parameters of Open Table & Printout shown below give errors in VC++
oDoCmd.OpenTable (TableName,acViewNormal,acReadOnly);
DoCmd.PrintOut [printrange][, pagefrom, pageto][, printquality][, copies][, collatecopies]
I don't know whether this is the desired approach to fulfill the 2 requirements mentioned above.Moreover, i don't know the desired parameters of opentable & printout in vc++(Preferably,they should be same as in vba but still these give errors. if possible, please give the exact parameters in any solution)
This is urgent. Please Help.
Thanks in anticipation,
Ankush Mehta.
Ankush Mehta
|
|
|
|
|
Hi All,
Requirement: i want to print the table in an MS Access Database.The Design is such that when i select a database using open Dialog, the corresponding tables in it should come in combo box automatically,i.e,
1) I should be able to retrieve the no. of tables & their names as well(not resolved)
2)on selecting any 1 table in combo box, i want to automate its printing through the click of a button.
I am using vc++ 6.0, office 2000.
Where i am: I tried a lot & searched a lot on net. a lot of material is available in vb/.net but in vc++ the same approach doesn't work out. Here is a snippet of the code:
if(!app.CreateDispatch("Access.Application"))
{
AfxMessageBox("Couldn't CreateDispatch on Excel");
return;
}
// Set visible.
app.SetVisible(TRUE);
app.OpenCurrentDatabase(m_FileName,TRUE);
//Get DoCmd Collection
lpDisp=app.GetDoCmd();
ASSERT(lpDisp);
// Attach the IDispatch pointer to the oDoCmd object
oDoCmd.AttachDispatch( lpDisp );
//Parameters of Open Table & Printout shown below give errors in VC++
oDoCmd.OpenTable (TableName,acViewNormal,acReadOnly);
DoCmd.PrintOut [printrange][, pagefrom, pageto][, printquality][, copies][, collatecopies]
I don't know whether this is the desired approach to fulfill the 2 requirements mentioned above.Moreover, i don't know the desired parameters of opentable & printout in vc++(Preferably,they should be same as in vba but still these give errors. if possible, please give the exact parameters in any solution)
This is urgent. Please Help.
Thanks in anticipation,
Ankush Mehta.
Ankush Mehta
|
|
|
|
|
Hi,
I use OnLButtonDown and OnLButtonUp because I want to control the left mouse button press and release over more than one button at the same time. However, if I click on the empty area of the dialog I get these functions called, while I cannot get them called when I click on the buttons themselves. There is no OnBnClickedButton..() function called. Do I have to change the properties of the buttons?
Thanks in advance
|
|
|
|
|
The standard Windows button issues the BN_CLICKED notification (which you handle via an OnBnClicked... function) when the button is released, not when it is pressed. If you want to perform an action when the button is pressed, you will need to create your own button class and handle the WM_LBUTTONDOWN message.
Software Zen: delete this;
|
|
|
|
|
The mouse message is going to the window that the cursor is over, since that's the window being acted on. So when you click the button, the button gets the message, not the button's parent. You'll need to subclass the button and handle WM_LBUTTONDOWN in your subclass.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|
|
Hi all,
I need to submit a HTML form via a SOCKET that is connected to an http server, more clearly, I want the http commands (GET/POST) that can imitiate sending HTML forms.
for example i have the folowing html form:
How can I send this form via a SOCKET that is connected to the HTTP server port 80?
any really good HTTP command reference? any good code about POSTING? anyone can solve the problem specifically for the above example??
Thanx in advance
Mohammad Gdeisat
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
have u tried theCInternetConnection class
&
CHttpConnection
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
use CHttpConnection to communicate with HTTP server.this will make a socket connection with ur http server
|
|
|
|
|
Mohammad, see this[^] article. If you also want to extract information from the downloaded HTML, see this[^] article.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
|
Hi,I wanna to develop a software with two network cards(Ethernet NIC).I hope I can select one of them to send and receive data with Udp protocol.Can i?Waiting for you answer.Thank you very much in advance.
|
|
|
|