|
oh yes ,I think you cant show icon on windows yes I see your problem but change background of icon to default color
|
|
|
|
|
Hi,
To simply draw icon with transparent background, you should apply AND mask to icon, where 1's specify transparency. For example: in VisualStudio editor, there's a color in color table, which looks like monitor with greeny background. By using this color, you specify which pixel are supposed to be transparent.
Finally, in DrawIconEx function you should specify DI_NORMAL effect mask to draw icon image as well as its mask.
Hope that helps,
Regards
|
|
|
|
|
the problem is that i have a thread function
<br />
UINT threadfun(LPVOID param)<br />
{<br />
CList list = (CList)param;<br />
}<br />
and i want to pass param to this function using AfxBeginThread
<br />
AfxBeginThread(threadfun,(WPARAM)m_List); <br />
where "m_List" is from a type defined variable
<br />
typedef CTypedPtrList<CPtrList , tagPLAYLISTENTRY*> CList;<br />
the compiler generate this error:
1- 'CList' : undeclared identifier
2- syntax error : missing ';' before identifier 'list'
3- 'list' : undeclared identifier
i know he can not see this type "CList" inside the function
but what is the solution of this , and how can i make it work
thnx alot 4 ur time and concern.
|
|
|
|
|
Is this file included...
#include <afxtempl.h>
|
|
|
|
|
yes it is included,
but as u know the thread function is not a part of the class so it can't see the headers so it don't know what is CList exactly is
problem right ??
i also tried to make the variable static and access it inside the thread function but it come up with an unresolved external error
F Y I, this time was working perfeclty in a member function of the class
but with the thread function, i don't know the problem
|
|
|
|
|
Hi,
yes it is included,
but as u know the thread function is not a part of the class so it can't see the headers so it don't know what is CList exactly is
Make sure that <afxtempl.h> can be parsed by precompiler when header with your thread function is processed. You can even add #include <afxtempl.h> statement directly before your thread function declaration,
example:
#include <afxtempl.h>
void __stdcall YourThreadFunction(LPVOID param)
{
CList list = (CList)param;
}
Did you know that your thread function can also be a part of your class?
#include <afxtempl.h>
class tester {
private:
CList m_list;
public:
void TestMyThread() {
CreateThread(...,...,YourThreadFunction,this,...,...)
};
static void YourThreadFunction(LPVOID param)
{
tester *p = (tester*)param;
CList list1 = p->m_list;
};
};
Regards
|
|
|
|
|
F Y I, typedef was working perfeclty in a member function of the class
but with the thread function, i don't know the problem
so it is not a problem with "typedef CTypedPtrList CList;"
because it was working before
|
|
|
|
|
singersinger wrote: typedef CTypedPtrList<CPtrList , tagPLAYLISTENTRY*> CList;
CList is the name of an existing class. Choose another name.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
singersinger wrote: UINT threadfun(LPVOID param)
{
CList list = (CList)param;
}
There are a few problems here.
First, CList is an existing type name when you use MFC. Use a different name for that: typedef CTypedPtrList CMyList; .
Second, CMyList will be a type, not a pointer. Use the reference operator to cast it to get a pointer to it: AfxBeginThread(threadfun, (WPARAM)&m_List); and the corresponding: UINT threadfun(LPVOID wParam) { CMyList* list = (CMyList*)wParam; ...}
Finally, if your threadfun is declared in another file, make sure it has the afxtempl.h header included.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
maybe i am posting the wrong words,
so to keep it simple
i have a function that causes the application to wait till it finishes it's work, so normally you would make it a thread function and call it using AfxBeginThread to let the application continue working after calling it
am i right in this ??
if i am right, this function uses some member variables that are declared in the class but the thread function can't see the member variables of the class
am i right ??
if i am, i want to pass this member variable to the thread function so that it could understand it and work with it "while this varibale not a rgular data type, it is a typedef from a combination of types"
can anybody help me with this
for any other information do not hesitate to reply
thnx alot 4 ur time and concern.
|
|
|
|
|
hi!
how do i change color of open file dialog or browse folder dialog?
(color of border, title and dialog)
to display open file dialog, i used CFileDialog::DoModal()
to display browse folder dialog, i used SHBrowseForFolder()
Zo.Naderi-Iran
|
|
|
|
|
You need to derived class of CFileDialog and use I think useWM_PAINT
|
|
|
|
|
Hopefully this is more specific, but what are boolean statments? If I'm posting in the wrong forum for C++ I'm sorry.
I'm a true failure.
|
|
|
|
|
(wrong_forum) == false
(5+1 > 0+2) == true
thursday.isaweekend() == false
(dog.has4legs() || hamster.canfly()) == true
wikipedia - boolean logic[^]
|
|
|
|
|
i'm not sure at all what you mean by "boolean statments", but if i understand it like you, it represents all the C++ statements that can be evaluated to a boolean.
if (a == 3) { ... }
for (int i = 0, i < 5; i++) { ... }
while(myIterator != myList.end()) {... }
and so on...
|
|
|
|
|
A boolean statment is true or false(1 or 0)key is on or key is off.
Anyway we have fazzy logic that it says we have many states between 1 and 0
|
|
|
|
|
I would say that false == 0, and true is a value that is not 0.
In most circumstances true == 1, but VARIANT_TRUE == -1, if my memory serves me right.
-- modified at 7:54 Monday 9th October, 2006
I found it at MSDN.
Here[^]
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Your memory is better than me
|
|
|
|
|
I did the mistake to test for true in a COM component once, that's why I remember. It just didn't work, so I had to find out why.
And the stuff we learn the hard way, that stuff stays.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
You are correct. false or FALSE is equal to 0, but when testing, you should assume true or TRUE (especially TRUE) is simple !false .
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I tried to use InternetSetOption() function to change or set options on IE some many times (a win32 function which is included in wininet C++ library)
and when i use any internet dial up i see the same settings like connection
time out, authotification..
This is my new function to call in WINMAIN entry point:
#include "stdafx.h"
#include "wininet.h"
...
//InternetConnectionOptions() function definition
BOOL InternetConnectionOptions()
{
INTERNET_PER_CONN_OPTION_LIST list;
BOOL bReturn;
DWORD dwBufSize = sizeof(list);
// fill out list struct
list.dwSize = sizeof(list);
// NULL == LAN, otherwise connectoid name
list.pszConnection = NULL;
// set three options
list.dwOptionCount = 3;
list.pOptions = new INTERNET_PER_CONN_OPTION[3];
// make sure the memory was allocated
if(NULL == list.pOptions)
{
//return FALSE if the memory wasn't allocated
return FALSE;
}
// set flags
list.pOptions[0].dwOption = INTERNET_PER_CONN_FLAGS;
list.pOptions[0].Value.dwValue = PROXY_TYPE_DIRECT |PROXY_TYPE_PROXY;
// set proxy name
list.pOptions[1].dwOption = INTERNET_PER_CONN_PROXY_SERVER;
list.pOptions[1].Value.pszValue = "http://proxy:80";
// set proxy override
list.pOptions[2].dwOption = INTERNET_PER_CONN_PROXY_BYPASS;
list.pOptions[2].Value.pszValue = "local";
// set the options on the connection
bReturn = InternetSetOption(NULL,
INTERNET_OPTION_PER_CONNECTION_OPTION, &list, dwBufSize);
//free the allocated memory
delete [] list.pOptions;
bReturn = InternetSetOption(hOpen,INTERNET_OPTION_USERNAME,
lpszUser, strlen(lpszUser)+1);//Here is the main problem !!
return bReturn;
}
note : hOpen is the Handle returned by InternetConnect() function
... and to be more specific when i go to Internet Explorer->Tools then Internet Options i see the same settings the username didn't change
Last Question: Why we couldn't include the first parameter as NULL in authentication setting (When we put the first parameter in InternetSetOption we mean that we change the defaulte setting .. Right??)
could someone tell me why its not working? or just
tell me how to use it well
Thank you.
"Anyone who considers arithmetical methods of producing random numbers is, of course, in a state of sin."
John von Neumann
|
|
|
|
|
Hi,
Ad.1.
Quote from MSDN about "INTERNET_OPTION_PER_CONNECTION_OPTION":
To refresh the global proxy settings, you must call InternetSetOption with the INTERNET_OPTION_REFRESH option flag. To set the settings on a per session basis, a valid session handle should be used.
Ad.2. You should probably use: INTERNET_OPTION_PROXY_USERNAME to set username for proxy auth. INTERNET_OPTION_USERNAME is used for InternetConnect for HTTP or FTP connections for example and not for Proxy authentication.
Hope that helps,
Best regards
|
|
|
|
|
Great thanks to you, i tried to add two functions :
InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0);
InternetSetOption(NULL, INTERNET_OPTION_REFRESH , NULL, 0);
but it still not working and i found an article for how to change Proxy settings "Change Internet Proxy settings" in this good web site in my program the changing 'default' setting is required not using a proxy i guess that you understand .. (i didn't find any method to change authotification
with default session WITH or WITHOUT InternetConnect returned hundle ).
Any idea ?
Anyone who considers arithmetical methods of producing random numbers is, of course, in a state of sin.
John von Neumann
|
|
|
|
|
You dont need to call InternetConnect function. The only function which is necessary for enabling Internet functionality in your app, is InternetOpen . You have to call this function in order to initialize all Wininet fucntionality in your app.
Calling InternetOpen , will give you HINTERNET handle which is used by InternetSetOption and others.
Best regards
|
|
|
|