|
trying to use CAPI, so I included the header on top of my WIN32 console app:
#include "stdafx.h"
#using <mscorlib.dll>
#include <tchar.h>
#include "wincrypt.h" <--- remove this, all problems are gone?
using namespace System;
// This is the entry point for this application
int _tmain(void)
{
return 0;
}
C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\Include\WinCrypt.h(37): error C2146: syntax error : missing ';' before identifier 'HRESULT'
The error trace to this line here:
#ifndef _HRESULT_DEFINED
#define _HRESULT_DEFINED
typedef LONG HRESULT; <-- THIS LINE
Any idea?
norm
|
|
|
|
|
This here is the C# forum, you want to go to the C++ forum.
Norm Almond:I seen some GUI's in my life but WTF is this mess
Leppie:I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
But, i already figured it out. Smart arses from MSDNS omitted:
#define _WIN32_WINNT 0x0400
#include <windows.h>
#include <wincrypt.h>
#define MY_ENCODING_TYPE (PKCS_7_ASN_ENCODING | X509_ASN_ENCODING)
man, just can't stop picking on MSDN people - perhaps I sufferred too much in my distant past doing MFC. Must say, reading their doc isn't the most efficient thing i do.
norm
|
|
|
|
|
I need to get the intersection of Green and Yellow in ARGB format
Is there a function for this.
And yes I know Color.GreenYellow exists but I need to know how to get intersections to achieve other mid way points.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Yellow is green and red together, from memory. Whatever it is, get the RGB value of red, green is obviously 0, 255, 0, and build a lookup table, or a function.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
but how do I calculate an intersection?
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Well, assuming that yellow is RGB 255, 255, 0, and green is obviously 0, 255, 0, there are 255 intersection points. Like so:
0, 255, 0
1, 255, 0
2, 255, 0
3, 255, 0
You get the idea.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Yes but since green is 0,128,0 and green yellow is 0,173,28 and yellow is 255,255,0
a simple matter of adding 1 to red does not get me any closer to the intersection since its not a linear equation.
I was hoping someone would know a math formula to calculate the intersection of the three planes basically.
nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
How can green be 0, 128, 0 ? It is green, as is any value with 0 red and 0 blue, but hard green is 255, surely ?
In any case, the system works the same way, forget greenyellow, it's obviously not the point halfway between the other two. Instead, add 2 to your red value for every 1 you add to your green value. Write up a program that does that and draws a gradient and see how it looks.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
thanks
By the way those are colors from the color namepsace. so obviously thier not dark colors
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Yeah, I guessed where they were from. I guess they have a dark green or something...
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
use hue-saturation-brightness...
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
do you have a link or some help for explanation
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
|
Treat each color value as a percentage 0=0%, 255=100%
So, a certain color might be (20%, 30%, 90%) in RGB
if you want to intersect that with another color (100%, 60%, 0%) the intersection will be the averages:
(60%, 45%, 45%)
Make sense?
|
|
|
|
|
heres a rough equation i got from my friend:
average the "Reds" - aa+11= bb bb/2 = 5D
bb+22 = DD dd/2 = 6e
cc+33 = ff ff/2 = 7f
so the average =c #aabbcc and #112233 = #5D6E7F
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
Yeah, it's pretty much the same thing.
(Ra + Rb)/2 = Ri
(Ba + Bb)/2 = Bi
(Ga + Gb)/2 = Gi
It makes sense since if you intersect a red line (255,0,0) with a black line (0,0,0) then the result should be a darker red line (128,0,0)
|
|
|
|
|
just mix them
Color c1=Color.Green;
Color c2=Color.Yellow;
Color mix=Color.FromArgb( (c1.r+c2.r)/2,(c1.g+c2.g)/2,(c1.b+c2.b)/2);
//Roger
|
|
|
|
|
I am experiencing a problem when trying to open a file using StreamReader inside a newly created thread.
My main program creates the thread as follows:
Thread t = new Thread(new ThreadStart(ProcessFileThreadOperation));
t.Start();
Pretty straight forward. If I remove the thread altogether and simply call
ProcessFileThreadOperation();
then everything works great, so I know that the code inside this method works fine. However when I call the method so that it can be run on a separate thread, I get an error as soon as it tries to open the StreamReader with the error:
Error: Logon failure: unknown user name or bad password.
So now my best guess is that file security permissions are not passed on to threads? If that's the case, anyone have any suggestions on a workaround? Any help would be _greatly_ appreciated...
Thanks,
Julie
|
|
|
|
|
I am having what appears to be a strange problem when I do File and or directory management using System.IO.
For example if I have the following lines of code:
Directory.Delete()
File.Copy()
Use the File
If the directory to be deleted is very large, it appears that while the directory is being deleted, the code jumps to the next line which is copy a file and the following line which is use the File. But since the directory deletion is not complete the File Copy or use hte file fails.
I cannot reproduce the problem in debug mode so am not sure what the hell is happening.
Have also noticed the problem when I was doing server maintenance and was deleting a few gigs of files manually. At the same time I was running my code that was writing files to the drive. Since the drive was busy it was taking time to write the files. What was strange is that it attempted to use the file before it finished writing it. Which is the same problem as I mentioned above. It seems to jump over a line of code to the next without completeing teh first, implying that the File IO is asynchronous or that something else is very evil in there
Is Directory.delete asynchronous? Is there a global setting that makes it asynchronous? Any ideas?
Thanks.
|
|
|
|
|
hi !
i have some troubles concerning dll-dependencies:
there is the main SIMULATOR class, which needs a lot of other classes (Class1,Class2,...)
this Simulator registers a channel for a remote object (COMMUNICATOR) and handles over a self-reference.
now. when i connect my GUI (on another pc) with this Communicator it seems that i need not only the simulator-class but all Class1,Class2 classes as a dll.
(because of the simulator-reference in communicator)
is this realy true, or is there another possibility
Class1
\
Class2 -- Simulator - Communicator <---REMOTE--->GUI
/
Class3
THANKS A LOT !!!!!!!!
|
|
|
|
|
hi !
can a constructor call another constructor of the same class?
in java it used to work as follows:
this(....);
--->
public class Test {
String Fname;
String Lname;
int id;
public Test(String Fname, String Lname) {
this.Fname=Fname;
this.Lname=Lname;
}
public Test(int id, String Fname, String Lname){
this(Fname,Lname); //!!!!!!!!!!!!!!!!!
this.id=id;
}
public static void main(String[] args){
Test t = new Test(1,"Tim","Taylor");
}
THANKS !
|
|
|
|
|
Sure. Here[^] is the language spec on the subject.
class Text
{
public Text(): this(0, 0, null) {}
public Text(int x, int y): this(x, y, null) {}
public Text(int x, int y, string s) {
}
}
α.γεεκ Fortune passes everywhere. Duke Leto Atreides
|
|
|
|
|
thank you!
i didn't find this anywhere.
|
|
|
|
|
I have made a custom control, which have a property named Items. Items is a collection. This collection can in the designer be changed by using the collection-editor accessed from the property viewer.
My problem is when I add items through the designer(collection-editor) in the property viewer. After adding a new item, it is shown in the control, but do I reload the form(by closing the window, and open it again), the item is not present - not visually in my control and not in the collection-editor.
I see that after adding items using the collection-editor, no code are added to the InitializeComponent function. I wonder if you need to do something specific to have it added correctly to the parents InitializeComponent function?
Thanks in advance,
Gooky
|
|
|
|
|