|
Thanks -
I will look into Direct Draw.
I appreciate your help. I may call on you again should I get stuck with the graphical widgets.
Greatly appreciated!!!
Casper
|
|
|
|
|
Alright here is the situation...I want to have an MFC image frame that when you drag a picture from a web site or hard drive onto the frame the program copies the image to a selected folder and displays the image in the frame. I found the option to accept files but i don't know what to do from there. Any assistance would be helpful. Thank You.
|
|
|
|
|
I have this program I made to do some stuff I wanted. It uses plain win32 (no-MFC) and draws a bitmap in a window. Well, at first I was just using normal GDI and StretchBlt and it worked perfectly, but I wanted bicubic interpolation so I converted it to GDI+. So it basicly works fantastically and looks much more crisp, but for some reason the redrawing is highly erratic. When it needs to redraw (after another window was hiding or something like that), it sometimes work but more often it doesn't work and just displays an empty window. Sometimes, however, you can see the image flicker as the window gets unhidden and then the image immidiately disappears. Also, when you would move the window so some of it is out of the monitor's bounderies and then move it quickly into show again, the image would have empty reigons that do not get redrawn even after letting go of the window. And it's not just the image: If I make it also fill a rect on the whole client area, it would have the same erratic behavior. So, it's not just the image. Is GDI+ known to have these oddities when redrawing? I haven't updated my GDI+ libraries or DLLs; My DLL is just what came in XP and my libraries are just what came with VS.NET 2003. I'm starting up GDI+ and shutting it down all just fine, and I link everything just fine and I don't get any unresolved externals or anything, and it does work, except for this weird redrawing issues.
Any help would be much aprreciated. Thanks.
|
|
|
|
|
Do draw in WM_PAINT , then the image always exist.
|
|
|
|
|
Exactly what I'm doing. The Bitmap object is created in WM_PAINT as well so it does exist. Besides when it doesn't redraw well, if you move a window over it to make it redraw it will sometimes make it redraw well. I doubt it has anything to do with the image file itself, especially seeing how it acts oddly with rect filling too.
|
|
|
|
|
Hi,
The subject pretty much says it all. What I'd like is an example in plain-jane C++ (I'm using Borland C++Builder) that implements a bare-bones edit/display control that demonstrates ITextHost, ITextServices and ITextDocument. I normally use Delphi and I'd like to get a better handle on windowless richedit controls so I can bypass the gawdawful TRichEdit and develop one which allows me to do more margins, borders, and such features.
Derek Benner
|
|
|
|
|
Hi,
I've developed a dll that, when registered, shows a browser band similar to the Yahoo or google toolbars within Internet Explorer. Now I want to put this dll on my webpage so anyone can download it.
My question is that is it possible to download and register it like you can an ActiveX control or will i need to come up with an installer package.
Thanks in advance.
|
|
|
|
|
i think froim a users point a view that a proper installer is nicer
I sorta like being asked permission before something installs itself etc
cheers
bryce
|
|
|
|
|
Seeking advice...
I want to use a CListCtrl to display assignment attributes I make for one or more files being parsed. I have an interface design for a parsing application that will accept one or more files, define attributes specific to each file, and then show in a CListCtrl the current assignments for a specific file.
My concern is how to maintain and refresh (quickly) the CListCtrl when I change from each file I have collected info already.
More on my design:
For each file, I identify what is to be parsed and where in a data structure it goes. This is basically a mapping and is displayed as a grid:
Field # Data Item Units
1 money USD
2 SSN text-ID
3 FirstName text
...
Each file can be different, and when I want to look at the attributes for each file I already configured, the mapping is displayed quickly in my CListCtrl.
Any advice?
Thanks,
Johnny
|
|
|
|
|
Hey,
I might be able to help you if you still haven't figured it out. I've worked a bit with the CListCtrl and could at least help you out in finding a solution.
You'll have to explain the problem a little more. From what I gather, the problem you have is that when you load something into the List Control it's taking quite a bit of time, in effect hanging the app for 3 or 4 seconds. I have that problem in one of my applications which I haven't bothered to fix, which is mainly why I want to help.
Anyway let me know if that is the problem you're talking about and if so we can try to figure out a better way of loading data into the list control. I have a few ideas, but not sure whether they will work or not.
Mike
|
|
|
|
|
Is there an advantage to use serilzation over writing your own Read File and Write File function?
Another question is \n and \r. If I read input with \r and output with TextOut I get blocky character if I write file with \n with ar I get blocky character and no carriage return I have to use \r. Do I need to write my own code to convert between \r and \n?
|
|
|
|
|
One benefit is polymorphism. For example:
int n;
double d;
char c;
ar << n << d << c; The ar object knows how to handle each type. If you were to write your own Write() method, you'd need one for each type. Here is another view.
As to your second question, TextOut() and the \r\n characters are generally not used in the same context. This is mainly because TextOut() supports the absolute positioning of the x and y reference points. In other words, if there existed a \n character in the string, you'd need to parse that out and adjust the y position before outputting more text.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
As the Java article points out... Simply stated - 'redirection of the IO stream'.
Read/Write to socket, or to file, or to com port, or to printer, etc.
Assuming you can change the 'Archiver' being used.
|
|
|
|
|
I need your expertise and opinion regarding database for my project that
I'm involve in. The project is written in C++ and store the data in the
Access database.
They are link using the ODBC driver. Then, I use the install shield to
make the whole application so that any user could install it in he/her
machine. So, when an administrator install the application, it has no
problem to access to the application or create new data and store them
in the database. But, when an local user tries to use the application,
he/she couldn't store or view the data to/from the database. How could I
grant the user the permission to view and modify the data without giving
the administrator privilege?
|
|
|
|
|
permissons
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|
|
Hi guys,
I am weak in my C++. Being struggling since start.
Does anyone know where i can get a similar source code which i can take reference from?
My assignment is this;
http://www.le.ac.uk/eg/computing/eg2020/2004ex4.pdf
if u can't view, please go this site instead, and click on exercise 4.
http://www.le.ac.uk/eg/computing/eg2020/
Thanks!
|
|
|
|
|
Can we assume that you've at least started? If so, what part of the project is giving you trouble?
Do you have code for converting base-10 numbers into Roman numerals? Once you have that, it's a simple matter of going through each Roman numeral and adjusting the array mentioned in the assignment. For example, if the Roman numeral was "MMDCCLXXXIII", you could adjust the array like:
int arr[7];
for (int i = 0; ...)
{
if (roman[i] == 'M')
arr[0]++;
else if (roman[i] == 'D')
arr[1]++;
else if (roman[i] == 'C')
arr[2]++;
else if (roman[i] == 'L')
arr[3]++;
else if (roman[i] == 'X')
arr[4]++;
else if (roman[i] == 'V')
arr[5]++;
else if (roman[i] == 'I')
arr[6]++;
} Now do the same thing with the second Roman numeral.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
hmmm.....having a hard time ,huh......chillout....assuming u know the basics.....herez a skeletal prgm.....
//since they have asked for atleast six functions,herez how i have seperated em as.....
#include<iostream.h>
#include<conio.h>
void getdata(int a,int b);
void convert(int num,int roman[]);
void add_roman_numeralz(int roman1[],int roman2[],int romansum[]);
void carry_correction(int roman[]);
void display_romansum(int roman[]);
void main(void)
{
int num1,num2,sum;
int roman1[7]=NULL,roman2[7]=NULL,roman3[7]=NULL;
clrscr();
//get the data from the user.....
getdata(num1,num2);
//convert num1 into roman
convert(num1,roman1);
//convert num2 into roman
convert(num2,roman1);
//perform the roman addition and get the added value in roman3
add_roman_numeralz(roman1,roman2,roman3);
//perform the carry correction for the added roman3
carry_correction(roman3);
//display the roman3
display_romansum(roman3);
getch();
}//end of void main(void)
void getdata(int &a,int &b)
{
cout<<"Enter the first number : ";
cin>>a;
cout<<"Enter the second number : ";
cin>>b;
}//end of the function
void convert(int num,int roman[7])
{
while(num>=1000)
{
roman[6]+=1;
num-=1000;
}
while(num>=500)
{
roman[5]+=1;
num-=500;
}
while(num>=100)
{
roman[4]+=1;
num-=100;
}
while(num>=50)
{
roman[3]+=1;
num-=50;
}
while(num>=10)
{
roman[2]+=1;
num-=10;
}
while(num>=5)
{
roman[1]+=1;
num-=5;
}
while(num>=1)
{
roman[0]+=1;
num-=1;
}
}//end of the function
void add_roman_numeralz(int roman1[7],int roman2[7],int romansum[7])
{
for(i=0;i<7;i++)
romansum[i]=roman1[i]+roman2[i];
}//end of function
void carry_correction(int roman[7]);
{
while(roman[0]>=5)//safer to give while,u can give if as well
{
roman[1]+=1;
roman[0]-=5;
}
while(roman[1]>=10)//safer to give while,u can give if as well
{
roman[2]+=1;
roman[1]-=10;
}
while(roman[2]>=50)//safer to give while,u can give if as well
{
roman[3]+=1;
roman[2]-=50;
}
while(roman[3]>=100)//safer to give while,u can give if as well
{
roman[4]+=1;
roman[3]-=100;
}
while(roman[4]>=500)//safer to give while,u can give if as well
{
roman[5]+=1;
roman[4]-=500;
}
while(roman[5]>=1000)//safer to give while,u can give if as well
{
roman[6]+=1;
roman[5]-=1000;
}
}//end of function
void display_romansum(int roman[]);
{
for(i=0;i<7;i++)
cout<<roman[i]<<"\n";
}//end of function
hope that helpz.....(never tried it out.....)
cheerz
|
|
|
|
|
Thanks for your help guys!
rateep, i have send an email to your yahoo.com inbox. Can u reply me soon? Thanks!
|
|
|
|
|
Hi,
I was wondering if someone with more knowledge of the windows XP and drivers can help me debug a problem. I use a CMU 1394 Camera driver that comes with an API to connect and capture some images from a camera. The problem is that after a few times of starting and stopping the program the program no longer runs with an error that there are not enough 1394 bus resources. So something doesn't get released, I need to restart the computer. I call the API functions from threads, but I check and I destroy all the threads after a certain time using:
if ( (::WaitForSingleObject( pThread1->m_hThread , 12000 )) == WAIT_TIMEOUT )
::TerminateThread( pThread1->m_hThread , 0 ) ;
Now the problem is that looking at my code I destroy all my threads. Using a program such as Sysinternals Process Explorer or the Task Manager all the threads and the process from my program get destroyed. I don't see what's holding the resources so that I can end it.
Any suggestions on programs or things to try?
Thanks.
|
|
|
|
|
terminating the thread might not be enough.
have you looked at where the 1394 (firewire ) bus is beeing used ? there must be a way to release the bus after that.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I can only guess at where the bus is being used by the library. I don't have the source code and if I didn't I wouldn't understand it for a while. Also I call all the functions that are supposed to stop your use of the driver...
Looks like I'm stuck.
|
|
|
|
|
Hi,
i've created my own tree control from a static window. The background is
transparent and all the items have a transparent background when not
selected. When and item is selected, I use a brush to fill the background:
::FillRect( hdc, &rBkgr, m_hBackBrush );
When an item is losing focus (being unselected), I do this:
::FillRect( hdc, &rItem, m_hNullBrush ); //Where m_hNullBrush is
GetStockObject( NULL_BRUSH );
The problem I have is that the item's background is not being refreshed. It
should be transparent so that the static window background should be
visible.
If I hide the window, the static control will refresh itself correctly. I've tried to use InvalidateRect() and UpdateWindow() but it does not work!
What can I do?
Thanks!
|
|
|
|
|
Never use UpdateWindow it can cause huge problems.
Use say:
HBRUSH CColorStatic::CtlColor(CDC* pDC, UINT nCtlColor)
{
HBRUSH hbr;
pDC->SetTextColor(m_crFg);
pDC->SetBkColor(m_crBg);
hbr = *m_pBrush;
return hbr;
}
Change the m_cr?? values and let the frame handle it.
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|
|
I am writing a program in c++ in which as the user types letters
in an ms dos console the letters are changed to whatever i want them to be.
For example if the person types "How are you" as they type i want to change the letters to "Whats up" instead...Do i have to change the cin code itself to not print to the screen or what?
|
|
|
|