I am trying to get a window to use the Windows 10 style and have succeeded in making the button itself be in that style (by modifying the executable file's manifest). However, the text is still very pixelated, reminiscent of the windows-classic style:
Setup code:
INITCOMMONCONTROLSEX initCommonControls = {
.dwSize = sizeof(INITCOMMONCONTROLSEX),
.dwICC = ICC_STANDARD_CLASSES
};
InitCommonControlsEx(&initCommonControls);
Button-create Code:
HWND startButton = CreateWindowExA(0, "BUTTON", "Start",
WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_VCENTER,
startButtonX, startButtonY, startButtonWidth, startButtonHeight, hWnd, NULL, hInstance, NULL);
Application manifest (the section sets the visual style):
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="*"
name="name.name.name"
type="win32" />
<description>a program</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*" />
</dependentAssembly>
</dependency>
<asmv3:application>
<asmv3:windowsSettings xmlns="https://schemas.microsoft.com/SMI/2016/WindowsSettings">
<dpiAwareness>PerMonitorV2</dpiAwareness>
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
Related
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="#c4c4c4">
<com.google.android.material.bottomappbar.BottomAppBar
android:id="#+id/bottomAppBar"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_gravity="bottom"
android:background="color/white"
app:fabCradleRoundedCornerRadius="10dp"
app:fabCradleMargin="4dp" />
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/bottomNavigationView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:menu="#menu/bottom_menu"
android:background="#android:color/transparent"
android:layout_gravity="bottom"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:layout_width="90dp"
android:layout_height="90dp"
android:backgroundTint="#color/white"
android:src="#drawable/qr"
app:fabCustomSize="90dp"
app:layout_anchor="#id/bottomAppBar"
app:maxImageSize="40dp"
tools:ignore="SpeakableTextPresentCheck" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.google.android.material.bottomappbar >this part error occured
the error is
"Android resource linking failed"
what can i do ???
i tried to fix <build.gradle>
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
}
someone tell that can be fixed when i downgrade material version
but it's not..
This question already has an answer here:
WPF-Log4Net used inside VSIX extension did not output log when installed at target VS
(1 answer)
Closed 4 years ago.
I have a WPF solution. I downloaded log4net dll, I added log4net.config and had set the "Copy to Output Directory" value as "Copy always".
log4net.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<log4net>
<root>
<level value="ALL" />
<appender-ref ref="LogFileAppender" />
</root>
<appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<file value="myapp.txt" />
<appendToFile value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="5" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %level %logger - %message%newline" />
</layout>
</appender>
</log4net>
</configuration>
And I added the below line in AssemblyInfo.cs:
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
then the below code in my TestWindowControl.xaml.cs
public partial class TestWindowControl : UserControl
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public TestWindowControl()
{
XmlConfigurator.Configure(new System.IO.FileInfo("log4net.config"));
log.Info("info testing");
log.Debug("debug testing");
log.Error("error testing");
log.Fatal("fatal testing");
log.Warn("warn testing");
}
}
But logs are not writing to the file. It's working in Console application but not working for WPF. Am I missing something?
Try to set the filter inside appender
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="WARN" />
<levelMax value="ERROR" />
</filter>
I want to place ad banner startapp at bottom of screen. it keeps appears on the top . i want it to be in the buttom of the screen you find my code down here ..
I am trying to position the ad at the bottom of the screen but nothing I try seems to work.
Below is the XML code for the layout thanks a lot .
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#mipmap/pictureone"
tools:context="org.sna.myapplication.MainActivity">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:background="#mipmap/pictureone"
android:weightSum="10"
android:clickable="false">
<TextView
android:layout_width="340dp"
android:layout_height="wrap_content"
android:text="click NEXT to start the application"
android:id="#+id/textView3"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"
android:textSize="30dp"
android:layout_weight="1.58"
android:textAlignment="center" />
<ImageView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="#+id/imageView6"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:background="#mipmap/oussama"
android:layout_marginTop="1dp"
android:clickable="true"
android:onClick="next" />
</LinearLayout>
<com.startapp.android.publish.ads.banner.Banner
android:id="#+id/startAppBanner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
tools:layout_editor_absoluteY="0dp"
tools:layout_editor_absoluteX="0dp" />
</android.support.constraint.ConstraintLayout>
Place the banner within your LinearLayout
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:background="#mipmap/pictureone"
android:weightSum="10"
android:clickable="false">
<TextView
android:layout_width="340dp"
android:layout_height="wrap_content"
android:text="click NEXT to start the application"
android:id="#+id/textView3"
android:layout_gravity="center_horizontal"
android:textColor="#ffffff"
android:textSize="30dp"
android:layout_weight="1.58"
android:textAlignment="center" />
<ImageView
android:layout_width="150dp"
android:layout_height="wrap_content"
android:id="#+id/imageView6"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:background="#mipmap/oussama"
android:layout_marginTop="1dp"
android:clickable="true"
android:onClick="next" />
<com.startapp.android.publish.ads.banner.Banner
android:id="#+id/startAppBanner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
tools:layout_editor_absoluteY="0dp"
tools:layout_editor_absoluteX="0dp" />
</LinearLayout>
My client ask me something who seems me very simple to do.
He has nopcommerce 1.9 web site , and he wish develop a simple windows forms application to modify clients adresses.
So i tryed to configure a news windows forms project :
static void Main(string[] args)
{
// Code that runs on application startup
NopConfig.Init();
//initialize IoC
IoC.InitializeWith(new DependencyResolverFactory());
//initialize task manager
TaskManager.Instance.Initialize(NopConfig.ScheduleTasks);
TaskManager.Instance.Start();
//open
new FormClient().Show();
TaskManager.Instance.Stop();
}
Then i create a service manager who expose data :
public class ServiceManager
{
public ICustomerService CustomerService;
public ServiceManager()
{
var dbContext = IoC.Resolve<NopObjectContext>();
CustomerService = new CustomerService(dbContext);
}
}
And impossible to access CustomerService methods because resolve method don't find the concrete class to instantiate for NopObjectContext;
(you can find nop commerce 1.9 in this location :
http://nopcommerce.codeplex.com/downloads/get/176949 )
Finally , it works :
App.config must be :
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="NopConfig" type="NopSolutions.NopCommerce.BusinessLogic.Configuration.NopConfig, Nop.BusinessLogic" requirePermission="false"/>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="NopSolutions.NopCommerce.BusinessLogic.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<appSettings>
<add key="dependencyResolverTypeName" value="NopSolutions.NopCommerce.BusinessLogic.Infrastructure.UnityDependencyResolver, Nop.BusinessLogic" />
</appSettings>
<connectionStrings>
<add name="NopEntities" connectionString="metadata=res://*/Data.NopModel.csdl|res://*/Data.NopModel.ssdl|res://*/Data.NopModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=EGG-BANKS;Initial Catalog=nopvierge2;Persist Security Info=True;User ID=sa;Password=sqlserver;MultipleActiveResultSets=True;Application Name=EntityFramework"" providerName="System.Data.EntityClient" />
<add name="NopSqlConnection" connectionString="Data Source=DAVID-TOSH\SQLEXPRESS;Initial Catalog=nop;Integrated Security=True;Persist Security Info=False;MultipleActiveResultSets=True;Connect Timeout=120" />
</connectionStrings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<applicationSettings>
<NopSolutions.NopCommerce.BusinessLogic.Properties.Settings>
<setting name="Nop_BusinessLogic_Clickatell_PushServerWS" serializeAs="String">
<value>http://api.clickatell.com/soap/webservice_vs.php</value>
</setting>
<setting name="Nop_BusinessLogic_EuropaCheckVatService_checkVatService" serializeAs="String">
<value>http://ec.europa.eu/taxation_customs/vies/services/checkVatService</value>
</setting>
</NopSolutions.NopCommerce.BusinessLogic.Properties.Settings>
</applicationSettings>
<NopConfig>
<SqlServer ConnectionStringName="NopSqlConnection"/>
<ScheduleTasks>
<Thread seconds="60">
<!--do NOT enable ClearCache task if you have enabled tracking online users-->
<task name="ClearCache" type="NopSolutions.NopCommerce.BusinessLogic.Caching.ClearCacheTask, Nop.BusinessLogic" enabled="false" stopOnError="false"/>
<task name="PurgeOnlineUsers" type="NopSolutions.NopCommerce.BusinessLogic.Audit.UsersOnline.PurgeOnlineUsersTask, Nop.BusinessLogic" enabled="true" stopOnError="false"/>
<task name="Emails" type="NopSolutions.NopCommerce.BusinessLogic.Messages.SendQueuedMessagesTask, Nop.BusinessLogic" enabled="true" stopOnError="false" maxTries="5"/>
<task name="KeepAlive" type="NopSolutions.NopCommerce.BusinessLogic.Utils.KeepAliveTask, Nop.BusinessLogic" enabled="true" stopOnError="false" path="keepalive/ping.ashx"/>
</Thread>
<Thread seconds="600">
<task name="DeleteExpiredCustomerSessions" type="NopSolutions.NopCommerce.BusinessLogic.CustomerManagement.DeleteExpiredCustomerSessionsTask, Nop.BusinessLogic" enabled="true" stopOnError="false" deleteExpiredCustomerSessionsOlderThanMinutes="43200"/>
<task name="DeleteExpiredShoppingCarts" type="NopSolutions.NopCommerce.BusinessLogic.Orders.DeleteExpiredShoppingCartsTask, Nop.BusinessLogic" enabled="false" stopOnError="false" deleteExpiredShoppingCartsOlderThanMinutes="259200"/>
</Thread>
<Thread seconds="60">
<task name="UpdateExchangeRates" type="NopSolutions.NopCommerce.BusinessLogic.Directory.ExchangeRates.UpdateExchangeRateTask, Nop.BusinessLogic" enabled="true" stopOnError="false"/>
</Thread>
<Thread seconds="3600">
<task name="DatabaseMaintance" type="NopSolutions.NopCommerce.BusinessLogic.Maintenance.DatabaseMaintanceTask, Nop.BusinessLogic" enabled="false" stopOnError="false"/>
</Thread>
</ScheduleTasks>
</NopConfig>
</configuration>
with program.cs file :
static void Main(string[] args)
{
// Code that runs on application startup
NopConfig.Init();
//initialize IoC
IoC.InitializeWith(new DependencyResolverFactory());
//initialize task manager
TaskManager.Instance.Initialize(NopConfig.ScheduleTasks);
TaskManager.Instance.Start();
new form1().show();
TaskManager.Instance.Stop();
}
Changed Response format to be like VS and error is now "Message Version not recognized"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<DiscordianResponse xmlns="http://reboltutorial.com/">
<DiscordianResult>Sweetmorn, Discord 48, Year of Our Lady of Discord 3176</DiscordianResult>
</DiscordianResponse>
</soap:Body>
</soap:Envelope>
I have generated a wsdl file with Visual Studio which is here;
http://reboltutorial.com/webservices/discordian.wsdl
Implementation is a cgi instead of a .net framework program but that should not matter as it is the purposes of webservices.
I tested it successfully with SoapSonar:
http://reboltutorial.com/images/soapsonar.png
But under Visual Studio it fails with this code:
private void button1_Click(object sender, EventArgs e)
{
RebolTutorial.ServiceSoapClient Discordian = new RebolTutorial.ServiceSoapClient("ServiceSoap");
int year = int.Parse(this.year.Text);
int month = int.Parse(this.month.Text);
int day = int.Parse(this.day.Text);
response.Text = Discordian.Discordian(year,month,day);
}
Any reason you can see ? Thanks.
Request below:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://reboltutorial.com/">
<soap:Body>
<tns:Discordian>
<tns:year>2010</tns:year>
<tns:month>5</tns:month>
<tns:day>1</tns:day>
</tns:Discordian>
</soap:Body>
</soap:Envelope>
as well as WSDL if needed:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://reboltutorial.com/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://reboltutorial.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://reboltutorial.com/">
<s:element name="Discordian">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="year" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="month" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="day" type="s:int" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="DiscordianResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DiscordianResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</wsdl:types>
<wsdl:message name="DiscordianSoapIn">
<wsdl:part name="parameters" element="tns:Discordian" />
</wsdl:message>
<wsdl:message name="DiscordianSoapOut">
<wsdl:part name="parameters" element="tns:DiscordianResponse" />
</wsdl:message>
<wsdl:portType name="ServiceSoap">
<wsdl:operation name="Discordian">
<wsdl:input message="tns:DiscordianSoapIn" />
<wsdl:output message="tns:DiscordianSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ServiceSoap" type="tns:ServiceSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Discordian">
<soap:operation soapAction="http://reboltutorial.com/Discordian" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="ServiceSoap12" type="tns:ServiceSoap">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="Discordian">
<soap12:operation soapAction="http://reboltutorial.com/Discordian" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Service">
<wsdl:port name="ServiceSoap" binding="tns:ServiceSoap">
<soap:address location="http://reboltutorial.com/cgi-bin/discordian.cgi" />
</wsdl:port>
<wsdl:port name="ServiceSoap12" binding="tns:ServiceSoap12">
<soap12:address location="http://reboltutorial.com/cgi-bin/discordian.cgi" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
I wrote that code http://www.rebolforces.com/zine/rzine-1-02/#sect6. 9 years ago and haven't really done much SOAP since then.
It works with the Soapclient at http://www.soapclient.com/soaptest.html
At that time I hand modified the wdsl ... wanna try mine?