|
sir ji
My application type of Single dialog based
and its style is Child and border is thin
In this case maximize and minimize property is
disable.
Can u told me any alternative way..............
Regard's
Kaushik
|
|
|
|
|
write this line in OnInitDialog function.
ModifyStyle (NULL, WS_MINIMIZEBOX);
Hope this will work.
By the way, why don't you just change your dialog style from child to popup ?
|
|
|
|
|
I know about the Two ways of making the .DLL.
1)extern "c" _declspec(dllexport) funX() {} and
2)Throught .Def file in which we are Writing only function names we want to export
EXPORT<br />
FunX @1
I have Some Question about that.
1)What is/are the diffn betn them and
2)What mean by extern "c"
3)"@" what is indication of this symbole. I tried without it and Dll Works Fine.
|
|
|
|
|
1) AFAIK, they are the same (but I'm not absolutely sure). You can have a look here[^]
2) extern "C" is needed when your dll is used in language other than C++. In C++, you have what is called function overloading (two functions with the same name and different arguments can exist). To resolve ambiguities, the linker uses decorated names to identify the different functions: it uses the function name ans some 'cryptic' characters that represent the arguments of the function. If you want to load a dll with LoadLibrary and use GetProcAddress, you have to supply the decorated name of the function, which is not very convenient.
So, using extern "C" means that the linker will use a C linkage (in C, you don't have function overloading) to identify the function: only the name is used.
This also means that you cannot overload your functions with extern "C".
|
|
|
|
|
From MSDN -
A module-definition (.def) file is a text file containing one or more module statements that describe various attributes of a DLL. If you are not using the __declspec(dllexport) keyword to export the DLL's functions, the DLL requires a .def file.
If you have functions in a DLL written in C++ that you want to access from a C-language module, you should declare these functions with C linkage (extern "c") instead of C++ linkage. Unless otherwise specified, the C++ compiler uses C++ type-safe naming (also known as name decoration) and C++ calling conventions, which can be difficult to call from C.
Moral of the story -
A .def file is required if you are not using __declspec(dllexport) keyword.
extern "c" stops the compiler from decorating the function names.
|
|
|
|
|
i am using Dialog based MFC application.
simple application i have create is add new node in Tree-view as text specified in edit box.
now problem is that when i am adding i dont want duplicated node being added to Tree-view.
i should get reference to already existing node when i try to add node with same text.
Help needed : how to search node in tree-view ..
|
|
|
|
|
You can use HTREEITEM hKid = GetChildItem (hParent); in a loop to get all the children of a parent, but the better idea is to maintain a array of nodes or labels that are already added in the tree.
You can search in the array to check if this node or label is already added.
If you want to check the labels, then it's always good to use CMapStringToString class, as you can directely check if the string is there or not. (In array, you have to search the whole array to find if item is there or not)
|
|
|
|
|
You have to search the node using GetNextItem. It will return the HTREEITEM. If the text is same, you can call SetItemState for that node
- NS -
|
|
|
|
|
Thank you ...
i am sooo that no direct function available ....
|
|
|
|
|
Hi all,
I'm trying to connect to an Oracle database, with the following function:
...
ret = SQLConnect(m_hDbc,
(SQLCHAR*)szDSN,
strlen(szDSN),
(SQLCHAR*)szUser,
strlen(szUser),
(SQLCHAR*)szPass,
strlen(szPass));
...
But I keep recieving the following error:
[Microsoft][ODBC driver for Oracle][Oracle]ORA-12154: TNS:could not resolve the connect identifier specified
I have added the entry to the tnsnames.ora file, and checked the "tnsping" using TNS service name, which worked.
Can anyone please help?
Many Thanks in advacne
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
hi
try this code to connect to oracle
SAConnection con; // connection object
SACommand cmd; // command object
{
con.Connect("test", "tester", "tester", SA_Oracle_Client);
cmd.setConnection(&con);
}
|
|
|
|
|
I want to know a computer's byte order.
Somebody would like to tell me how to get the order?
Thanks.
GOOD LUCK.
|
|
|
|
|
It depends on your CPU. I believe most (if not all) PCs are Little-Endian, meaning (going off memory here) that the bytes are ordered, within a word, with the least significant byte first. You can google "Endian-ness" for a more complete and correct answer.
|
|
|
|
|
OK,I will go and have a look.
Thanks.
|
|
|
|
|
|
Maxwell Chen wrote: Endianness[^]
Were you afraid that kcynic would not be able to Google the suggestion from Azteke correctly?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
One way to do it. I'm not sure if it works on 64-bits CPU's though.
Remark (before I get flamed): Yes, it is old C code.
Detection of Little- and Big-endian:
bool bIsLittleEndian = false;
unsigned int test = 0x12345678;
unsigned char firstByte = *(unsigned char *) &test;
if(firstByte == 0x78) bIsLittleEndian = true;
Detection of Little-, Middle and Big-endian:
enum {LITTLE_ENDIAN, MIDDLE_ENDIAN, BIG_ENDIAN};
int endian;
unsigned int test = 0x12345678;
unsigned char firstByte = *(unsigned char *) &test;
if(firstByte == 0x78) endian = LITTLE_ENDIAN;
else if(firstByte == 0x34) endian = MIDDLE_ENDIAN;
else endian = BIG_ENDIAN;
-- modified at 5:38 Friday 14th September, 2007
Maxwell Chen made me aware there are such a thing as Middle-endian, so I made another sample. (Middle-endian is appearantly used in some PDAs and mobile phones that is using CPU's with ARM architecture.)
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
|
Thanks for the comment.
I will change my reply, since it could be fatal to execute my code on a PDP 11 machine.
OK, it seems as some PDAs and mobile phones uses CPU's with ARM architecture. That scenario seems a bit more likely. I will change my reply accordingly.
Thaks for pointing it out.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Kakan,
That's interesting, I never though of using code to determine the Endian=Ness. I'll remember that.
Azteke
|
|
|
|
|
Hi, I'm working on a project where I need to do the following:
1) Constantly (at some defined rate that approximates "constant") sample the microphone input.
2) Take the input that is read and determine the frequency of the tone being input.
If it's possible, number 2 would run on each execution cycle. The idea is to have a big if-block that performs different logic depending on what range the frequency is in.
What I need is an API (and a document to help explain it would be helpful) that will allow me to do this sampling/frequency determination. I'm new to PC programming for the most part, coming from about a year and a half of embedded (fairly basic) development, but I'm excited to start learning! I do know the basics of MFC apps/dialogs and I have VS2005 Professional at my disposal.
The one last thing is that I would like this to run on Linux also eventually so if there's a good API that is cross-platform that would be ideal if it doesn't add too much trouble.
Much appreciated,
Tim
|
|
|
|
|
|
Ressell, after a quick scan-through I think that third link is exactly what I need. Thanks. Does anyone know of a cross platform API though for future Linux ports?
Thanks,
Tim
|
|
|
|
|
Thanks
About Linux:
I don't know anything about it to help you, sorry.
You can start a new thread,...but think also to post it in another forum: here more than 90% of members are expert on Windows. I don't want to mean that here noone can help you, but that it is not so impossible.
good luck
Russell
|
|
|
|
|
Hello,
Good Day!
Step 1:
struct user
{
unsigned short us_nbs;
unsigned short us_debit;
unsigned short us_flowctrl;
};
Step 2:
In another header file contains this:
"class C_User : public CObject, public user"
Step 3:
class C_Subscriber : public C_User
Step 4:
C_Subscriber subdeviceSubs = *lpSubscr;
Step 5:
I got that us_flowctrl value is "0" by executing this statement : subdeviceSubs.us_flowctrl. How?
Thanks in advance
Raja Ratheesh
-- modified at 1:56 Friday 14th September, 2007
|
|
|
|