|
Bingo!
Thanks, pardon my earlier cynicism... now to post a new problem with the debug heap...
|
|
|
|
|
Hello,
can someone help me with this problem in ETSLayoutManager??
thax
break;
|
|
|
|
|
Err... That's a very clear description of your problem
|
|
|
|
|
Hello Moonen,
sorry :->, ETSLayoutDialog Manager is here in the comunity, a litle framework to manage the dialog items,
mean, when dialog resize, normaly all dlg items stay on the same place, with this framework you can
replace and resize all items!
Here is the url:
http://www.codeproject.com/dialog/layoutmgr.asp
and my try:
<br />
CMyDialog* pdlg = ((CMyDialog*)m_cTabAll.GetTab(0));<br />
<br />
CPane DIALOG = paneCtrl( pdlg, HORIZONTAL, RELATIVE_VERT, 0,0,-125,0)<br />
<< item(pdlg, GREEDY);<br />
<br />
CPane TABCTRL = paneTab(&m_cTabAll,HORIZONTAL, GREEDY)<br />
<< DIALOG<br />
<< itemGrowing(VERTICAL);<br />
<br />
CreateRoot(VERTICAL)<br />
<< TOOLBAR
<< TABCTRL<br />
<< PROGRESS<br />
<< itemGrowing(HORIZONTAL)<br />
<< itemGrowing(HORIZONTAL)<br />
<< item(IDC_STATUSBAR, ABSOLUTE_VERT);<br />
<br />
<br />
UpdateLayout();<br />
hope this is a litle more information!
with best regards
berak;
|
|
|
|
|
If it comes from an article, then it's better to post in the message board at the bottom of the article if the article doesn't provide enough information.
|
|
|
|
|
Hi,
yes, that what i think before, but, in this artikle does nobody maintain this posts, they are no answers on questions !?
Therefore i think maybe is someone in the comunity who use this framework to and so can help me???
regards
break;
|
|
|
|
|
I built this little CD player for use in one of my apps using standard MCI strings and commands. What I can't figure out, is how to direct the output to a particular sound card.
By default, the output goes to whatever is the primary sound device at the time, but I figure there "must" be a way to redirect it, without changing the default output card.
Anybody do this before?
|
|
|
|
|
Hey, Rick.
I've got some MCI code in an app at the house and I'll be happy to look at it to see if I've fought that battle already. It's been awhile, and I've slept since then.
The tricky part will be remembering to take a look. Send me an email from this post to remind me, and I'll poke around and see if I can help. I seem to recall that you can enumerate the devices. If so, I'll shoot you some code.
|
|
|
|
|
hello. i am writing certain data from memory into file on the disk. how can i write the same data into a file on the FTP server??? is the process of writing data to an FTP file is same as that of writing data on to file in the local disk??
vijay
|
|
|
|
|
|
There is no such a thing called "FTP file". FTP is a protocol, which is used to transfer data in two formats: ASCII and binary.
Maybe you can clearify a bit about what you wanted? If you write data to the FTP server, which is mapped as mapped network drives on your local machine, then the write is just as you're writing to a local drive.
Best,
Jun
|
|
|
|
|
How Can i Call a Function Providing its name as a string in C\C++
|
|
|
|
|
Name as a string? Can you be more specific? I do not get this question.
Brahmma
According to the laws of aerodynamics, the bumble bee must not be able to fly. The bumble bee does not know aerodynamics. It goes on flying anyway.
|
|
|
|
|
Simple answer: you can't.
But, why would like to do such a thing ? Provide as much relevant information you can so we can help you to find a better solution (it probably results from a bad design).
|
|
|
|
|
Hi,
Function as a string?? Why? ... but ...
You can get the address of a function with
<br />
FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName);<br />
You need the module handle and the name of the function.
Example for the function GetMenu from user32.dll
<br />
typedef HMENU (WINAPI *GETMENU) (HWND);<br />
GETMENU FuncGetMenu;<br />
HMODULE hUser32Dll;<br />
<br />
_hUser32Dll = ::LoadLibrary("user32.dll");<br />
if(NULL != hUser32Dll)<br />
{<br />
FuncGetMenu = (GETMENU)::GetProcAddress(hUser32Dll, "GetMenu");<br />
}<br />
<br />
if(NULL != FuncGetMenu)<br />
{<br />
FuncGetMenu(WindowHandle);
}<br />
This is an example for dynamic load a dll.
--> You need more than only the function name! You also need the function declaration.
HTH
Frank
|
|
|
|
|
you can't, not directly anyway.
but, you could create a map that maps strings (names) to function pointers.
|
|
|
|
|
The next sample for Visual Studio 2005 uses map and function pointers:
#include "stdafx.h"
#include "math.h"
#include <map>
#include <string>
void main()
{
using namespace std;
typedef double (* FUNCTION_POINTER)(double);
map< string, FUNCTION_POINTER > functions;
functions["sin"] = sin;
functions["cos"] = cos;
functions["tg"] = tan;
std::string name;
name = "cos";
FUNCTION_POINTER function = functions[name];
double result = function(1.2);
}
I hope it works and gives you some ideas.
|
|
|
|
|
a piece of cake, function pointer or functors can do this.
boost
|
|
|
|
|
Complementing to the other answers already given, the quick answer would be no, at least not in the way BASIC (for example) lets you do it (something like execute("a=myfunc(10,20)").
The process of calling functions based on the contents of a string has to be manually coded in some way. The most "automatic" way is the already mentioned "GetProcAddress" (you can hide most of the steps required inside macros or in a general purpose function), but prototypes will be always a pain (unless if they are, trivially, the same).
Depending on the extent of work you are willing to do, you can go as far as building your own C/C++ interpreter. I did this once, for a home automation system, where I made a program to go through all of my header files, scan function names and prototypes, and write code to execute the correct function with the correct parameters based on the contents of a string (the command entered by the user). Is not very hard work if you control the classes and functions. If not then be prepared for trouble.
I hope this helps,
Rilhas
|
|
|
|
|
I have a question.
Are these same?
1. Close the client application window. [ Closes the stream ],
(Server gets out of the below block)
<br />
do<br />
{<br />
n=recv(client,buff,MAX_BUFF_SIZE,0);<br />
if(n==SOCKET_ERROR ) <br />
{<br />
break;<br />
}<br />
}while()<br />
2. UnPlug the client's network cable. [should close the stream?] ,
server never gets notified? it never happens. WTF???
I'm not able to detect the latter one. Please help. If the n/w cable is unplugged, the stream would be broken and it should fire a sock exception right?
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
Hi,
the value from SOCKET_ERROR is -1
if you unplug the network recv will be return 0
Change your code to
<br />
do<br />
{<br />
n=recv(client,buff,MAX_BUFF_SIZE,0);<br />
if(1 > n)<br />
{<br />
break;<br />
}<br />
}while();<br />
HTH
Frank
|
|
|
|
|
Nope! It doesn't work. The disconnection is not detected. Please help.
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
TCP does _not_ maintain a connection, it only maintains information about the connection.
Unplugging the cable merely prevents data from moving.
You need to implement a ping or timeout type feature in your protocol if you want to be notified if/when the cable is unplugged.
See:
http://tangentsoft.net/wskfaq/newbie.html#abnormalclose[^]
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Thanks for the link!! I just stopped tussling with the issue. Implementing a sensor now
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
Hi all,
I'm struggling with the following:
I have these two pointer:
<code>char* username = "value1";
char* servername = "value2";</code>
And these other two pointers:
<code>
unsigned short* uni_domain;
unsigned short* uni_username;
</code>
And I'm trying to assign the fisrt two pointer values to the second two pointer, I tried the following:
<code>
uni_domain = (LPWSTR)username;
uni_username = (LPWSTR)servername;
</code>
But the function : <code>NetUserGetInfo</code> is not equal to <code>NERR_Success</code>, which indicates its not valid.
When I do this it works:
<code>
uni_domain = L"value1";
uni_username = L"value2";
</code>
But I'm sending values to a function, and the above will not help my cause.
Can anyone help me?
Only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|