|
Hi everybody, Am in great trouble.
I have a project MyApp.exe which is a big project. It has some 20-30 dll dependencies on it. The resource (including dialog boxes) is in a separate dll. This project had been developed in VC6 previously and has now been ported to .NET. Its running fine.
The thing is, I want to make the dialog boxes appear with the Windows XP visual style. So, when an user selects Windows XP style from Control Panel->Appearance tab, the appearance of the dialogs should change too. It must not have the classic style appearance.
For this, I have followed the methods outlined in MSDN site. I am giving the links too.
1) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwxp/html/xptheming.asp
2) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/userex/cookbook.asp
Th process given above works fine for a simple dialog-based project.
But, where, even the resource is in a separate dll, there, it doesn't work.
PLEASE DO GIVE ME ANY FEEDBACK OR SUGGESTIONS ASAP.
Thanks and Regards,
Anind
|
|
|
|
|
Hi,
I want to add IP address programatically. Any idea how can I do this. I know of one function AddIPAddress, but it is for IPv4. Thanks for help.
Regards
Alpha
|
|
|
|
|
Hi, My questions deals with Template Functions.
I am suppose to code these functions and write a driver program to test them with various types of arrarys. Each templated function should work on any size array of any type.
<b>sortArrary</b> to sort an array in ascending order (using < comparison) <b>NOTE: I must pass the array and its size. I can use either a selection sort or an insertion sort. </b>
<b>searchArry </b> to look for a target element in a given arrary and return the locations or -1 if the target is not found. This is to be a binary search. <b>NOTE: I must pass in a <i>sorted</i> array, its size, and the target element</b>.
<b>deleteItem</b> to delete an item from an arrary. <b>NOTE: I have to pass in an arrary, its size, and the targe5t to be deleted. I must pass in a <i>sorted</i> array, its size, and the target element</b>.
I am having trouble writing these functions....
Thanks alot...Jason
|
|
|
|
|
This looks like a homework assignment, so I won't give you a ready solution, but will point out a few steps that will help you forward.
Templated functions are declared as follows:
template<typename Type>
void sortArray(Type* ptrArray, unsigned int nSize); This is a declaration of a templated function that takes a pointer to the first cell of the array, and the size of the array. To pass a whole array, change the first parameter to Type tgtArray[] .
The key is to first write a function that does the job for, say, an array of integers. Then, by interpreting and understanding the above declaration, you can easily change the function to support any type that has comparison operators (< and >) defined. This includes all basic types (int, char, float, double etc)
Hope this helps
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi all !
I read a code which contained a #pragma key. I researched in MSDN lib but can't understand detail it. Can you explain me about this keyword ? thank alot.
example: #pragma abc
hanhquang
|
|
|
|
|
There are defined pragma , you need to give exact code you read there.
#pragma abc is not valid pragma option.
|
|
|
|
|
//statement 1 (embed ASM)
#pragma asm
_CPU_WDTMR .equ 0060h
push.l er2 ;
mov.w #10000,e2 ; /* 48 * 10000 state */
_wt100_0:
mov.w #h'0ff,r2 ; /* 2-state */
mov.w #h'0ff,r2 ; /* 2-state */
mov.b r2l,@(_CPU_WDTMR:32) ; /* 5-state */
mov.b r2l,@(_CPU_WDTMR:32) ; /* 5-state */
mov.b r2l,@(_CPU_WDTMR:32) ; /* 5-state */
mov.b r2l,@(_CPU_WDTMR:32) ; /* 5-state */
mov.b r2l,@(_CPU_WDTMR:32) ; /* 5-state */
mov.b r2l,@(_CPU_WDTMR:32) ; /* 5-state */
mov.b r2l,@(_CPU_WDTMR:32) ; /* 5-state */
mov.b r2l,@(_CPU_WDTMR:32) ; /* 5-state */
dec.w #1,e2 ; /* 1-state */
bne _wt100_0 ; /* 3-state */
pop.l er2 ;
#pragma endasm
// statement 2:
#pragma SYN_SFSLCT (*(volatile u_char *)0x200402)
Above, It's two statement relate to #pragma. Please explain clearly to help me. thank alot
hanhquang
|
|
|
|
|
In Simple terms it is used to set compiler options.
Regards
Alpha
|
|
|
|
|
All,
I need to implement a circular linked list of circular linked lists. I can generate the individual linked lists just fine but can't quite figure out how to link the lists together. My node has pointers to a right node and a down node. So, a list would be node->right to node->right etc, but I can't figure out how to link a list using the down pointer without loosing the pointer to the first node. Any advice?
Thanks in advance (and I hope this makes sense...)
John
|
|
|
|
|
The solution is to think in 3D.
First, consider that you have a circle of cells. This represents the top level linked list. Each cell contains an index number (integer) and a pointer to the next node of the circle. This linked list is called 'primary list'.
Now, enhance each of these cells so that they also contain a second pointer. Each of these cells becomes the first cell of a secondary linked list that rotates from the 2D plane up, does a circle, and returns down again. The second pointer points to the next cell of the secondary linked list.
Here is a declaration of the cell structure
struct Node {
int nNumber;
element_type* ptrNext;
element_type* ptrDown;
}; The primary linked list has valid values in all entries. ptrNext points to the next cell in the primary list, and ptrDown points to the next cell in the secondary list. The secondary list has two types of cells:
a) Members of the primary and secondary lists, with valid values in all entires
b) Members of the secondary list only, with a NULL value in ptrNext
In the primary list, the nNumber entry contains an index number that identifies an individual list from the chain, e.g. list at index position 1. In order to keep it simple, you could use negative values in the primary chain, and positive values in secondary chains. This would make it easy to identify any given cell: if it's value is negative, it's the linking cell between a secondary and a primary list. If it's positive, it's an individual cell in some secondary list.
If the above was implemented, then those cells with negative values would be the headers of the secondary lists, as stated in ADT language. The primary linked list might also have a header. This header's ptrDown value should be NULL, or index value should be 0, to seperate it from the other members of the primary list and the members of the secondary lists.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
I'm trying ot write a IRC program and I've hit a snag. Getting the string into pieces is tough for me, I've tried strtok, memcopy, copymemory, all that crap and I just can't seem to get it right, the program just crashes.
This is basicly what I need to parse:
:Nick!Stuff@=HostOrSomething.eggormuffin PRIVMSG #channel :hi\r\n
I need to get it into:
Nick
PRIVMSG
#channel
hi
If you could give me some advice, some code, or an article I would greatly appreciate it
wWw.KruncherInc.cOm
|
|
|
|
|
Why dont u write your own parsing function.
Imagine that you are creating a fabric of human destiny with the object of making men happy in the end, giving them peace and rest at last, but that it was essential and inevitable to torture to death only one tiny creature..and to found that edifice on its unavenged tears, would you consent to be the architect on those conditions? Tell me, and tell me the truth!
-Fyodor Dostoevsky, The Brothers Karamazov
|
|
|
|
|
What's wrong with:
CString strSource = ":Nick!Stuff@=HostOrSomething.eggormuffin PRIVMSG #channel :hi\r\n",
str1,
str2,
str3,
str4;
AfxExtractSubString(str1, strSource, 0, '!');
AfxExtractSubString(str2, strSource, 1, ' ');
AfxExtractSubString(str3, strSource, 2, ' ');
AfxExtractSubString(str4, strSource, 2, ':');
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Because I am using WIN32 API, no MFC.
wWw.KruncherInc.cOm
|
|
|
|
|
Technically, MFC is also using the WIN32 API, but your point is taken nonetheless. I like to say that an apple is a fruit, but a fruit is not an apple.
Try this for starters:
LPCSTR lpszSource = ":Nick!Stuff@=HostOrSomething.eggormuffin PRIVMSG #channel :hi\r\n",
lpszPtr;
TCHAR szStr1[32],
szStr2[32],
szStr3[32],
szStr4[32];
lpszPtr = strchr(lpszSource, '!');
lstrcpyn(szStr1, lpszSource, lpszPtr - lpszSource + 1);
lpszSource = lpszPtr + 1;
lpszPtr = strchr(lpszSource, ' ');
lpszSource = lpszPtr + 1;
lpszPtr = strchr(lpszSource, ' ');
lstrcpyn(szStr2, lpszSource, lpszPtr - lpszSource + 1);
lpszSource = lpszPtr + 1;
lpszPtr = strchr(lpszSource, ' ');
lstrcpyn(szStr3, lpszSource, lpszPtr - lpszSource + 1);
lpszSource = lpszPtr + 2;
lpszPtr = strchr(lpszSource, '\r');
lstrcpyn(szStr4, lpszSource, lpszPtr - lpszSource + 1);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
ok, what you need to do is go make a loop to go thorugh each character of the string
im assuming the first character is alwase going to be a ":"
so i would start at position 1 (the second character)
you know the whats between ":" and "!" is the user name (i assume) so make a variable for the user name
if you havent hit a "!" then add that character into the variable for user name,
what i would do is make a an array like
char szMsgInfo[3][512];
szMsgInfo[0] (Username)
szMsgInfo[1] (PRIVMSG)
szMsgInfo[2] (#channel)
szMsgInfo[3] (message)
have a variable to store what element you are on,
if you hit a ":" then you are on 0
if you hit a "!" then you are on 1
when you hit a " " then you are on 2
when you hit another " " then you are on 3
then when you hit another ":" you are on the message
hope that helped some
|
|
|
|
|
What is the easiest way for changing CButton (MFC) text control??
Please help
|
|
|
|
|
the only way i know of is to use CreateFont
|
|
|
|
|
can do it by using CWnd::OnCtlColor. Have a look @ the MFC Library Reference @ msdn
|
|
|
|
|
Hi guys,
Can anybody give me any pointers on how to make an mfc/C++ application upgradable? I've written the app, created a setup project, and am about to distribute it. But if in two months time i want to release an upgrade to my program, what should I do?
I have absolutely no idea how upgrades work, or what I have to do to make my application upgradable.
I'd be grateful for any general guidelines or principles about what I should do. I don't need any sample code or anything, just general suggestions about the approaches I might take.
Thanks for your help. i realise this thread is a bit vague, I can provide more information about my app if anybody requests it.
Mick
|
|
|
|
|
Well, you can distribute a new exe, or make a patch that updates the old one. Or load the functionality that you might update from dlls, and update those
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Thanks Christian. I realize that just replacing the old exe with a new one is the easiest option, but this is not as elegant as distributing an upgrade that is nice and small, and only replaces the bits of the program that are out of date. So I guess I would like to make "a patch that updates the old one". But how do I do that? Once I have compiled my exe, surely I can't change anything in its code?
Thanks for replying!
Mick
|
|
|
|
|
Oh right, so I think I understand. I have to compile each class as a dll, then replace the dlls that are being upgraded, leaving the remainder as they are?
Mick
|
|
|
|
|
You can do that, choosing just the classes that you're likely to change. Or you can use a tool which basically diffs the two exes ( old and new ) and then makes a program which takes the differences, and merges them into the existing ( old ) app on the client machine.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
In MS Studio VC++ 6.0, I want use the following code to get Local PC IP Address, However IPString is always returned as "0.0.0.0" why???
Thanks for any suggestion.
void CDispipDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CMySocket pp;
CString IPString;
UINT nPort;
pp.Create();
if(pp.GetSockName(IPString,nPort))
{
AfxMessageBox(IPString);
}
else
{
AfxMessageBox("Got an Error");
}
}
|
|
|
|
|